Upgrade Replicated TimesTen Databases

You can upgrade a replicated TimesTen configuration, consisting of an active standby pair of TimesTen databases.

The upgrade process requires you to perform the following steps:
  • Create a YAML file. In this file, you specify the container image that contains the new release of TimesTen.

  • Uses the helm values command for the upgrade. The example shows you how to do this.

The example assumes you have created a new_kube_files/helm/customyaml directory.

Note:

The following actions occur during an upgrade:
  • The standby is terminated first. It takes some time for the standby to come back up. When the standby comes back up, it 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.

  • Next, the failover from the active to the standby occurs:

    • The active is terminated. It takes some time for the former active to come back up. When the active comes back up, it is upgraded to the new release.

    • The standby database is promoted to the active and the former active becomes the standby.

For more information about how TimesTen performs an upgrade of an active standby pair of TimesTen databases, see Performing an Upgrade with Active Standby Pair Replication in the Oracle TimesTen In-Memory Database Installation, Migration, and Upgrade Guide.

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 may experience short outages and perhaps reduced performance as a result of the upgrade procedure.

  1. On your development host, change to the helm directory that contains the new Helm charts.
    cd new_kube_files/helm
  2. Create a YAML file and in it specify the name of the TimesTen image you want to use for the upgrade.
    vi customyaml/upgradereplicated.yaml
    
    image:
      repository: container-registry.oracle.com/timesten/timesten
      tag: "22.1.1.28.0"
  3. Before the upgrade, do the following:
    1. Confirm the replicated TimesTenClassic object exists in your namespace.
      kubectl get ttc 
      The output is similar to the following:
      NAME              STATE              ACTIVE            AGE
      norepsamplehelm   AllReplicasReady   N/A               8h
      repsamplehelm     Normal             repsamplehelm-0   11h

      The repsamplehelm TimesTenClassic object exists and is in the Normal state.

    2. Verify the image.
      kubectl describe ttc repsamplehelm | grep Image
      The output is similar to the following:
      Image:       container-registry.oracle.com/timesten/timesten:22.1.1.27.0
      ...
  4. Confirm the ttclassic chart release.
    helm list
    The output is similar to the following:
    NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                   APP VERSION
    repsamplehelm   default         1               2024-08-04 14:58:40.109402333 +0000 UTC deployed        ttclassic-2211270.1.0   22.1.1.27.0
  5. Upgrade to the new release. Use the ttclassic chart from the new release and use the customized YAML file that references the new image.

    Note:

    We recommend the following syntax. This ensures existing customizations are preserved.
    helm get values repsamplehelm --all > prev-values-repttc.yaml
    helm upgrade -f prev-values-repttc.yaml -f customyaml/upgradereplicated.yaml  repsamplehelm ./ttclassic
    Let's look at this helm upgrade command:
    • The get values repsamplehelm Helm command retrieves the values for the current release, including existing customizations. The result of this command is piped into the prev-values-repttc.yaml file. You can choose any name for this file.

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

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

    Release "repsamplehelm" has been upgraded. Happy Helming!
    NAME: repsamplehelm
    LAST DEPLOYED: Mon Aug  5 02:25:13 2024
    NAMESPACE: default
    STATUS: deployed
    REVISION: 2
    NOTES:
    Version 2211280.1.0 of the ttclassic chart has been installed.
    
    This release is named "repsamplehelm".
    
    To learn more about the release, try:
    
      $ helm status repsamplehelm
      $ helm get all repsamplehelm
      $ helm history repsamplehelm
    
    To rollback to a previous version of the chart, run:
    
      $ helm rollback repsamplehelm <REVISION>
        - run 'helm history repsamplehelm' for a list of revisions.
    Note the following:
    • The repsamplehelm chart release is upgraded. The release revision is 2.

    • The status of the release is deployed.

    • The ttclassic chart version is 2211280.1.0 corresponding to TimesTen release 22.1.1.28.0.

  6. Observe the automatic upgrade and how the TimesTenClassic object transitions from and to various states.
     kubectl get events -w

    The output is similar to the following:

    11m         Normal    Upgrade                  timestenclassic/repsamplehelm   Image updated, automatic upgrade started
    11m         Normal    Upgrade                  timestenclassic/repsamplehelm   Deleted standby pod repsamplehelm-1 during upgrade
    11m         Warning   Failed                   timestenclassic/repsamplehelm   Pod repsamplehelm-1 was replaced
    11m         Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-1 is Not Ready
    11m         Warning   StateChange              timestenclassic/repsamplehelm   TimesTenClassic was Normal, now ActiveTakeover
    11m         Normal    StateChange              timestenclassic/repsamplehelm   TimesTenClassic was ActiveTakeover, now StandbyDown
    9m26s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 Agent Up
    9m26s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 Instance Exists
    9m26s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 Daemon Down
    9m26s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 Daemon Up
    9m26s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 Database Unloaded
    9m24s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 Database None
    9m21s       Normal    Info                     timestenclassic/repsamplehelm   pollAsyncStatus: Async polling for RepDuplicate, timeout in 597 secs
    9m18s       Normal    Info                     timestenclassic/repsamplehelm   pollAsyncStatus: Async polling for RepDuplicate, timeout in 594 secs
    9m15s       Normal    Info                     timestenclassic/repsamplehelm   pollAsyncStatus: Async polling for RepDuplicate, timeout in 591 secs
    9m12s       Normal    Info                     timestenclassic/repsamplehelm   pollAsyncStatus: Async polling for RepDuplicate, timeout in 588 secs
    9m9s        Normal    Info                     timestenclassic/repsamplehelm   pollAsyncStatus: Async polling for RepDuplicate, timeout in 585 secs
    9m6s        Normal    Info                     timestenclassic/repsamplehelm   RepDuplicate completed in 16 secs
    9m5s        Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 Database Loaded
    9m5s        Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 RepAgent Not Running
    9m5s        Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 RepScheme Exists
    9m5s        Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-1 RepState IDLE
    9m          Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 Database Loaded
    9m          Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 RepAgent Running
    9m          Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 RepScheme Exists
    9m          Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-1 RepState STANDBY
    9m          Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-1 is Ready
    8m59s       Normal    Upgrade                  timestenclassic/repsamplehelm   Upgrade of standby complete
    8m59s       Normal    StateChange              timestenclassic/repsamplehelm   TimesTenClassic was StandbyDown, now Normal
    8m28s       Normal    Upgrade                  timestenclassic/repsamplehelm   Deleted active pod repsamplehelm-0 during upgrade
    7m27s       Warning   Error                    timestenclassic/repsamplehelm   Pod repsamplehelm-0 Unreachable for 119 seconds
    7m27s       Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-0 is Not Ready
    7m27s       Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-0 is Not Active Ready
    7m27s       Warning   StateChange              timestenclassic/repsamplehelm   TimesTenClassic was Normal, now ActiveDown
    7m27s       Warning   Failed                   timestenclassic/repsamplehelm   Pod repsamplehelm-0 was replaced
    7m26s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-1 Database Updatable
    7m26s       Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-1 RepState ACTIVE
    7m26s       Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-1 is Not Ready
    7m26s       Normal    StateChange              timestenclassic/repsamplehelm   TimesTenClassic was ActiveDown, now ActiveTakeover
    7m21s       Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-1 is Ready
    7m21s       Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-1 is Active Ready
    7m21s       Normal    StateChange              timestenclassic/repsamplehelm   TimesTenClassic was ActiveTakeover, now StandbyDown
    6m17s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-0 Agent Up
    6m17s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-0 Instance Exists
    6m17s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-0 Daemon Down
    6m16s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-0 Daemon Up
    6m16s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-0 Database Unloaded
    6m14s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-0 Database None
    6m11s       Normal    Info                     timestenclassic/repsamplehelm   pollAsyncStatus: Async polling for RepDuplicate, timeout in 597 secs
    6m8s        Normal    Info                     timestenclassic/repsamplehelm   pollAsyncStatus: Async polling for RepDuplicate, timeout in 594 secs
    6m5s        Normal    Info                     timestenclassic/repsamplehelm   pollAsyncStatus: Async polling for RepDuplicate, timeout in 591 secs
    6m2s        Normal    Info                     timestenclassic/repsamplehelm   pollAsyncStatus: Async polling for RepDuplicate, timeout in 588 secs
    5m59s       Normal    Info                     timestenclassic/repsamplehelm   RepDuplicate completed in 13 secs
    5m58s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-0 Database Loaded
    5m58s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-0 RepAgent Not Running
    5m58s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-0 RepScheme Exists
    5m58s       Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-0 RepState IDLE
    5m53s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-0 Database Loaded
    5m53s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-0 RepAgent Running
    5m53s       Normal    Info                     timestenclassic/repsamplehelm   Pod repsamplehelm-0 RepScheme Exists
    5m53s       Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-0 RepState STANDBY
    5m53s       Normal    StateChange              timestenclassic/repsamplehelm   Pod repsamplehelm-0 is Ready
    5m52s       Normal    Upgrade                  timestenclassic/repsamplehelm   Upgrade of active complete
    5m52s       Normal    Upgrade                  timestenclassic/repsamplehelm   Upgrade completed in 350 secs
    5m52s       Normal    StateChange              timestenclassic/repsamplehelm   TimesTenClassic was StandbyDown, now Normal

    The automated upgrade process completes. The TimesTenClassic object is in the Normal state. TimesTen databases are up and running and functioning properly. Active standby pair replication is configured between them.

  7. After the upgrade, do the following:
    1. Confirm the replicated TimesTenClassic object is in the Normal state and the active is repsamplehelm-1.
      kubectl get ttc 
      The output is similar to the following:
      NAME            STATE    ACTIVE            AGE
      repsamplehelm   Normal   repsamplehelm-1   11h
    2. Verify the image.
      kubectl describe ttc repsamplehelm | grep Image
      The output is similar to the following:
      Image:       container-registry.oracle.com/timesten/timesten:22.1.1.28.0
      ...
  8. (Optional): Use helm test to test TimesTen.
     helm test repsamplehelm

    The output is similar to the following:

    NAME: repsamplehelm
    LAST DEPLOYED: Mon Aug  5 02:25:13 2024
    NAMESPACE: default
    STATUS: deployed
    REVISION: 2
    TEST SUITE:     repsamplehelm-ttclassic-test
    Last Started:   Mon Aug  5 02:49:22 2024
    Last Completed: Mon Aug  5 02:49:26 2024
    Phase:          Succeeded
    NOTES:
    Version 2211280.1.0 of the ttclassic chart has been installed.
    
    This release is named "repsamplehelm".
    
    To learn more about the release, try:
    
      $ helm status repsamplehelm
      $ helm get all repsamplehelm
      $ helm history repsamplehelm
    
    To rollback to a previous version of the chart, run:
    
      $ helm rollback repsamplehelm <REVISION>
        - run 'helm history repsamplehelm' for a list of revisions.

    The test succeeeds.

Congratulations! You successfully completed an automated upgrade for a replicated TimesTenClassic object. The TimesTenClassic object is upgraded and is in the Normal state. The replicated active standby pair of TimesTen databases are running the new release and are fully operational.