Upgrade TimesTen

You can upgrade a TimesTenClassic object and its active standby pair of TimesTen Classic databases to a new TimesTen release.

To upgrade TimesTen, use the ttclassic chart from the new release.

This example upgrades from TimesTen release 22.1.1.19.0 to 22.1.1.20.0. For more information about TimesTen releases, see Overview of release numbers in the Oracle TimesTen In-Memory Database Installation, Migration, and Upgrade Guide.

Let's assume you previously created the new_kube_files directory and unpacked the new release of the TimesTen Operator distribution into this directory.

The ttclassic chart contains all the information necessary to upgrade an active standby pair of TimesTen Classic databases that are deployed in your namespace. The chart contains a default configuration for deploying a new release of TimesTen. In addition, if the default container image is not the image you want to upgrade to, you can modify the ttclassic's chart default image variable to reference your new container image. For example, if the default container image for the new release is container-registry.oracle.com/timesten/timesten/22.1.1.20.0 and instead you want to use your newly built phx.ocir.io/youraccount/tt2211200image:2 container image, you modify the image variable in the following way:
image: 
  repository: phx.ocir.io/youraccount/tt2211200image
  tag: "2"

Let's walk through an example illustrating how to upgrade the ttclassic chart, which upgrades an active standby pair of TimesTen databases to a new release. In the example, let's assume you want to use your phx.ocir.io/youraccount/tt2211200image:2 container image.

The example uses a customized YAML file to define the container image that contains the new release. Let's assume you have previously created a new_kube_files/helm/customyaml directory for your customized YAML files.

Note:

When an upgrade is performed, the standby is terminated first. It takes some time for the standby to come back up. During this wait period, the standby is upgraded to the new release. During the upgrade of the standby, depending on your replication configuration, there may be disruption on the active database. This may impact your applications. Next, the failover from the active to the standby occurs. The active is terminated. There is a wait period for the former active to come back up. During this wait period, the active is upgraded to the new release. The standby database is promoted to the active and the former active becomes the standby.

Ensure you perform an upgrade at the appropriate time. We recommend that you do not perform upgrades at the busiest time of a production day. Applications see shortages and perhaps reduced performance as a result of the upgrade procedure.

  1. Review the TimesTenClassic object is deployed and is in the Normal state.
    kubectl get ttc samplettc

    Output.

    NAME        STATE    ACTIVE        AGE
    samplettc   Normal   samplettc-0   20h
  2. Verify the TimesTenClassic object is running the expected image.
    kubectl get ttc samplettc -o yaml | grep image

    Output.

        image: phx.ocir.io/youraccount/tt2211190image:1
        imagePullPolicy: Always
        imagePullSecret: sekret
        imageUpdatePending: false
    

    The TimesTenClassic object is running the expected image.

  3. On your development host, change to the helm directory of the new release.
    cd new_kube_files/helm

    This directory contains the new release of the charts. For more information about the helm directory, see Set Up the Environment.

  4. Create a YAML file that references the new container image.
    vi customyaml/samplettc.yaml
    
    image:
      repository: phx.ocir.io/youraccount/tt2211200image
      tag: "2"
    imagePullSecret: sekret
    The customizations are as follows:
    • Since the container image you built and want to use for the upgrade is phx.ocir.io/youraccount/tt2211200image:2, the value of the repository variable is phx.ocir.io/youraccount/tt2211200image and the value of the tag variable is 2.

    • The image pull Secret is sekret.

  5. Confirm the name of the release for the ttclassic chart.
    helm list
    Output.
    NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                   APP VERSION
    samplettc       mynamespace     1               2023-10-23 23:18:03.740512897 +0000 UTC deployed        ttclassic-2211190.1.0   22.1.1.19.0
    samplettop      mynamespace     2               2023-10-24 16:15:24.896107706 +0000 UTC deployed        ttoperator-2211200.1.0  22.1.1.20.0
    ttcrd           mynamespace     2               2023-10-24 16:10:21.530832896 +0000 UTC deployed        ttcrd-2211200.1.0       22.1.1.20.0

    The helm list command shows the samplettc release exists and is installed in your namespace.

  6. Upgrade the TimesTenClassic object and its active standby pair of databases to a new release. To upgrade, use the ttclassic chart from the new release and use the customized YAML file that references the new image.
    helm get values samplettc --all > prev-values-ttc.yaml && helm upgrade -f prev-values-ttc.yaml -f customyaml/upgradettc.yaml  samplettc ./ttclassic
    
    Let's look at this helm upgrade command:
    • The get values samplettc Helm command retrieves the values for the current release, including existing customizations. The result of this command is piped into the prev-values-ttc.yaml file. You can choose any name for this file.

    • The helm upgrade command uses the prev-values-ttc.yaml file with the customized upgradettc.yaml file to do the upgrade.

    Note:

    We recommend this syntax. This ensures existing customizations are preserved.

    Let's look at the output from the helm upgrade command.

    Release "samplettc" has been upgraded. Happy Helming!
    NAME: samplettc
    LAST DEPLOYED: Tue Oct 24 19:55:45 2023
    NAMESPACE: mynamespace
    STATUS: deployed
    REVISION: 2
    NOTES:
    Version 2211200.1.0 of the ttclassic chart has been installed.
    
    This release is named "samplettc".
    
    To learn more about the release, try:
    
      $ helm status samplettc
      $ helm get all samplettc
      $ helm history samplettc
    
    To rollback to a previous version of the chart, run:
    
      $ helm rollback samplettc <REVISION>
        - run 'helm history samplettc' for a list of revisions.
    Note the following:
    • The samplettc release is upgraded. The release revision is 2.

    • The status of the release is deployed.

    • The ttclassic chart version is 2211200.1.0 corresponding to the 22.1.1.20.0 TimesTen release.

    • The TimesTenClassic object will be replaced by one that is using the new image. This causes the TimesTen Operator to automatically upgrade both databases in the active standby pair to the new release.

  7. Observe the automatic upgrade.
     kubectl describe ttc samplettc

    Output.

    Name:         samplettc
    Namespace:    mynamespace
    Labels:       app.kubernetes.io/managed-by=Helm
    Annotations:  meta.helm.sh/release-name: samplettc
                  meta.helm.sh/release-namespace: mynamespace
    ...
    Events:
      Type     Reason       Age    From      Message
      ----     ------       ----   ----      -------
      Normal   Upgrade      7m44s  timesten  Image updated, automatic upgrade started
      Normal   Upgrade      7m44s  timesten  Deleted standby pod samplettc-1 during upgrade
      Normal   Info         6m43s  timesten  Pod samplettc-1 Agent Down
      Normal   Info         6m42s  timesten  Pod samplettc-1 Agent Up
      Normal   Info         6m42s  timesten  Pod samplettc-1 Instance Exists
      Normal   Info         6m42s  timesten  Pod samplettc-1 Daemon Down
      Normal   StateChange  6m42s  timesten  Pod samplettc-1 is Not Ready
      Warning  StateChange  6m42s  timesten  TimesTenClassic was Normal, now ActiveTakeover
      Normal   StateChange  6m42s  timesten  TimesTenClassic was ActiveTakeover, now StandbyDown
      Normal   Info         6m42s  timesten  Pod samplettc-1 Agent Down
      Normal   Info         6m37s  timesten  Pod samplettc-1 Agent Up
      Normal   Info         6m37s  timesten  Pod samplettc-1 Instance Exists
      Normal   Info         6m37s  timesten  Pod samplettc-1 Daemon Down
      Normal   Info         6m37s  timesten  Pod samplettc-1 Daemon Up
      Normal   Info         6m37s  timesten  Pod samplettc-1 Database Unloaded
      Normal   Info         6m35s  timesten  Pod samplettc-1 Database None
      DEBUG    Info         6m32s  timesten  pollAsyncStatus: Async polling for RepDuplicate, timeout in 597 secs
      DEBUG    Info         6m29s  timesten  pollAsyncStatus: Async polling for RepDuplicate, timeout in 594 secs
      DEBUG    Info         6m26s  timesten  pollAsyncStatus: Async polling for RepDuplicate, timeout in 591 secs
      DEBUG    Info         6m23s  timesten  pollAsyncStatus: Async polling for RepDuplicate, timeout in 588 secs
      Normal   Info         6m20s  timesten  Pod samplettc-1 Database Loaded
      Normal   Info         6m19s  timesten  Pod samplettc-1 RepAgent Not Running
      Normal   Info         6m19s  timesten  Pod samplettc-1 RepScheme Exists
      Normal   StateChange  6m19s  timesten  Pod samplettc-1 RepState IDLE
      Normal   Info         6m14s  timesten  Pod samplettc-1 RepAgent Running
      Normal   StateChange  6m14s  timesten  TimesTenClassic was StandbyDown, now StandbyStarting
      Normal   StateChange  6m13s  timesten  TimesTenClassic was StandbyStarting, now StandbyCatchup
      Normal   StateChange  5m36s  timesten  Pod samplettc-1 RepState STANDBY
      Normal   Upgrade      5m36s  timesten  Upgrade of standby complete
      Normal   StateChange  5m36s  timesten  TimesTenClassic was StandbyCatchup, now Normal
      Normal   Upgrade      5m4s   timesten  Deleted active pod samplettc-0 during upgrade
      Normal   Info         5m4s   timesten  Pod samplettc-0 Agent Down
      Normal   StateChange  4m59s  timesten  Pod samplettc-0 is Not Ready
      Normal   StateChange  4m59s  timesten  Pod samplettc-0 is Not Active Ready
      Normal   StateChange  4m59s  timesten  Pod samplettc-1 is Ready
      Warning  StateChange  4m59s  timesten  TimesTenClassic was Normal, now ActiveDown
      Normal   Info         4m57s  timesten  Pod samplettc-1 Database Updatable
      Normal   StateChange  4m57s  timesten  Pod samplettc-1 RepState ACTIVE
      Normal   StateChange  4m57s  timesten  Pod samplettc-1 is Not Ready
      Normal   StateChange  4m57s  timesten  TimesTenClassic was ActiveDown, now ActiveTakeover
      Normal   StateChange  4m56s  timesten  Pod samplettc-1 is Ready
      Normal   StateChange  4m56s  timesten  Pod samplettc-1 is Active Ready
      Normal   StateChange  4m56s  timesten  TimesTenClassic was ActiveTakeover, now StandbyDown
      Normal   Info         4m6s   timesten  Pod samplettc-0 Agent Up
      Normal   Info         4m6s   timesten  Pod samplettc-0 Instance Exists
      Normal   Info         4m6s   timesten  Pod samplettc-0 Daemon Down
      Normal   Info         4m6s   timesten  Pod samplettc-0 Daemon Up
      Normal   Info         4m6s   timesten  Pod samplettc-0 Database Unloaded
      Normal   Info         4m4s   timesten  Pod samplettc-0 Database None
      DEBUG    Info         4m1s   timesten  pollAsyncStatus: Async polling for RepDuplicate, timeout in 597 secs
      DEBUG    Info         3m58s  timesten  pollAsyncStatus: Async polling for RepDuplicate, timeout in 594 secs
      DEBUG    Info         3m55s  timesten  pollAsyncStatus: Async polling for RepDuplicate, timeout in 591 secs
      DEBUG    Info         3m52s  timesten  pollAsyncStatus: Async polling for RepDuplicate, timeout in 588 secs
      Normal   Info         3m48s  timesten  Pod samplettc-0 Database Loaded
      Normal   Info         3m48s  timesten  Pod samplettc-0 RepAgent Not Running
      Normal   Info         3m48s  timesten  Pod samplettc-0 RepScheme Exists
      Normal   StateChange  3m48s  timesten  Pod samplettc-0 RepState IDLE
      Normal   Info         3m43s  timesten  Pod samplettc-0 RepAgent Running
      Normal   StateChange  3m43s  timesten  TimesTenClassic was StandbyDown, now StandbyStarting
      Normal   StateChange  3m42s  timesten  TimesTenClassic was StandbyStarting, now StandbyCatchup
      Normal   StateChange  2m56s  timesten  Pod samplettc-0 RepState STANDBY
      Normal   Upgrade      2m56s  timesten  Upgrade of active complete
      Normal   Upgrade      2m56s  timesten  Upgrade completed in 288 secs
      Normal   StateChange  2m56s  timesten  TimesTenClassic was StandbyCatchup, now Normal
  8. Confirm the TimesTenClassic object is in the Normal state.
    kubectl get ttc samplettc

    Output.

    NAME        STATE    ACTIVE        AGE
    samplettc   Normal   samplettc-1   20h
    

    The TimesTenClassic object is in the Normal state. The samplettc-1 is now the active.

  9. Confirm the TimesTenClassic object is running the new image.
    kubectl get ttc samplettc -o yaml | grep image

    Output.

        image: phx.ocir.io/youraccount/tt2211200image:2
        imagePullPolicy: Always
        imagePullSecret: sekret
        imageUpdatePending: false
    

    The TimesTenClassic object is running the new image.

  10. (Optional): Test the ttclassic release.
     helm test samplettc

    Output.

    NAME: samplettc
    LAST DEPLOYED: Tue Oct 24 19:55:45 2023
    NAMESPACE: mynamespace
    STATUS: deployed
    REVISION: 2
    TEST SUITE:     samplettc-ttclassic-test
    Last Started:   Tue Oct 24 20:12:30 2023
    Last Completed: Tue Oct 24 20:12:35 2023
    Phase:          Succeeded
    NOTES:
    Version 2211200.1.0 of the ttclassic chart has been installed.
    
    This release is named "samplettc".
    
    To learn more about the release, try:
    
      $ helm status samplettc
      $ helm get all samplettc
      $ helm history samplettc
    
    To rollback to a previous version of the chart, run:
    
      $ helm rollback samplettc <REVISION>
        - run 'helm history samplettc' for a list of revisions.

    The test for revision 2 of the samplettc release succeeded.

  11. Confirm the samplettc release is upgraded.
    helm list

    Output.

    
    NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                   APP VERSION
    samplettc       mynamespace     2               2023-10-24 19:55:45.303709067 +0000 UTC deployed        ttclassic-2211200.1.0   22.1.1.20.0
    samplettop      mynamespace     2               2023-10-24 16:15:35.896107706 +0000 UTC deployed        ttoperator-2211200.1.0  22.1.1.20.0
    ttcrd           mynamespace     2               2023-10-24 16:00:21.530832896 +0000 UTC deployed        ttcrd-2211200.1.0       22.1.1.20.0

    The ttclassic chart version is 2211200.1.0 corresponding to the 22.1.1.20.0 TimesTen release.

Congratulations! You successfully performed the upgrade. The TimesTenClassic object is upgraded and is in the Normal state. The associated active standby pair of TimesTen Classic databases are upgraded. Both databases are up and running.