Perform an Automated Upgrade of a Replicated TimesTenClassic Object

Before starting the automated upgrade, note the following:

Note:

An automated upgrade happens immediately. The TimesTen Operator takes down your databases, restarts them, and then initiates and completes the fail over process. Do not perform this procedure at the busiest time of your production day. Applications see short outages and perhaps reduced performance as a result of the upgrade procedure.

Let's perform an automated upgrade for a replicated TimesTenClassic object.

  1. Review the TimesTenClassic objects running in your namespace.
    kubectl get ttc

    The output is similar to the following:

    NAME             STATE              ACTIVE           AGE
    mannorepsample   AllReplicasReady   N/A              30h
    manrepsample     Normal             manrepsample-0   54m
    norepsample      AllReplicasReady   N/A              21h
    repsample        Normal             repsample-0      50m

    There are several TimesTenClassic objects running in your namespace. One of the replicated TimesTenClassic objects is repsample. Its high level state is Normal indicating TimesTen databases in the active standby pair are up and running and functioning properly.

  2. Review the image upgrade strategy for the object.
    kubectl get ttc repsample -o yaml | grep imageUpgradeStrategy

    The output is the following:

    imageUpgradeStrategy: Auto

    The image upgrade strategy is Auto (also the default), indicating an automated upgrade strategy.

  3. On your development host, edit the TimesTenClassic object's .spec.ttspec.image datum with the container image you want to use for the upgrade. This example uses container-registry.oracle.com/timesten/timesten:22.1.1.35.0.
    1. Edit the file, replacing the image value with container-registry.oracle.com/timesten/timesten:22.1.1.35.0.
       kubectl edit ttc repsample
      
      # Please edit the object below. Lines beginning with a '#' will be ignored,
      # and an empty file will abort the edit. If an error occurs while saving this file will be
      # reopened with the relevant failures.
      #
      apiVersion: timesten.oracle.com/v4
      kind: TimesTenClassic
      ...
          image: container-registry.oracle.com/timesten/timesten:22.1.1.35.0
      ...
    2. Save the file and exit from the editor.
  4. Confirm the StatefulSet contains the new image.
    kubectl describe statefulset repsample | grep Image

    The output is the following:

    Image:      container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:      container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:      container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:      container-registry.oracle.com/timesten/timesten:22.1.1.35.0

    When the TimesTen Operator detects that there is an update to the TimesTenClassic's .spec.ttspec.image datum, it modifies the StatefulSet with the new image. Since this is an automated upgrade of a replicated TimesTenClassic object, the TimesTen Operator takes action and initiates and orchestrates the upgrade process.

  5. Monitor the progress of the upgrade, observing the state transitions.
    kubectl get events -w

    The output is similar to the following:

    LAST SEEN   TYPE      REASON                   OBJECT                      MESSAGE
    ...
    8m4s        Normal    Upgrade                  timestenclassic/repsample   Image updated, automatic upgrade started
    8m4s        Normal    Upgrade                  timestenclassic/repsample   Deleted standby pod repsample-1 during upgrade
    7m59s       Warning   Failed                   timestenclassic/repsample   Pod repsample-1 was replaced
    7m54s       Normal    StateChange              timestenclassic/repsample   Pod repsample-1 is Not Ready
    7m54s       Warning   StateChange              timestenclassic/repsample   TimesTenClassic was Normal, now ActiveTakeover
    7m53s       Normal    StateChange              timestenclassic/repsample   TimesTenClassic was ActiveTakeover, now StandbyDown
    5m28s       Normal    Info                     timestenclassic/repsample   Pod repsample-1 Agent Up
    5m28s       Normal    Info                     timestenclassic/repsample   Pod repsample-1 Instance Exists
    5m28s       Normal    Info                     timestenclassic/repsample   Pod repsample-1 Daemon Down
    5m28s       Normal    Info                     timestenclassic/repsample   Pod repsample-1 Daemon Up
    5m28s       Normal    Info                     timestenclassic/repsample   Pod repsample-1 Database Unloaded
    5m25s       Normal    Info                     timestenclassic/repsample   Pod repsample-1 Database None
    5m10s       Normal    Info                     timestenclassic/repsample   Pod repsample-1 Database Loaded
    5m10s       Normal    Info                     timestenclassic/repsample   Pod repsample-1 RepAgent Not Running
    5m10s       Normal    Info                     timestenclassic/repsample   Pod repsample-1 RepScheme Exists
    5m10s       Normal    StateChange              timestenclassic/repsample   Pod repsample-1 RepState IDLE
    5m4s        Normal    Info                     timestenclassic/repsample   Pod repsample-1 Database Loaded
    5m4s        Normal    Info                     timestenclassic/repsample   Pod repsample-1 RepAgent Running
    5m4s        Normal    Info                     timestenclassic/repsample   Pod repsample-1 RepScheme Exists
    5m4s        Normal    StateChange              timestenclassic/repsample   Pod repsample-1 RepState STANDBY
    5m4s        Normal    StateChange              timestenclassic/repsample   Pod repsample-1 is Ready
    5m3s        Normal    Upgrade                  timestenclassic/repsample   Upgrade of standby complete
    5m3s        Normal    StateChange              timestenclassic/repsample   TimesTenClassic was StandbyDown, now Normal
    4m32s       Normal    Upgrade                  timestenclassic/repsample   Deleted active pod repsample-0 during upgrade
    3m31s       Warning   Error                    timestenclassic/repsample   Pod repsample-0 Unreachable for 117 seconds
    3m31s       Normal    StateChange              timestenclassic/repsample   Pod repsample-0 is Not Ready
    3m31s       Normal    StateChange              timestenclassic/repsample   Pod repsample-0 is Not Active Ready
    3m31s       Warning   StateChange              timestenclassic/repsample   TimesTenClassic was Normal, now ActiveDown
    3m30s       Warning   Failed                   timestenclassic/repsample   Pod repsample-0 was replaced
    3m29s       Normal    Info                     timestenclassic/repsample   Pod repsample-1 Database Updatable
    3m29s       Normal    StateChange              timestenclassic/repsample   Pod repsample-1 RepState ACTIVE
    3m29s       Normal    StateChange              timestenclassic/repsample   Pod repsample-1 is Not Ready
    3m29s       Normal    StateChange              timestenclassic/repsample   TimesTenClassic was ActiveDown, now ActiveTakeover
    3m25s       Normal    StateChange              timestenclassic/repsample   Pod repsample-1 is Ready
    3m25s       Normal    StateChange              timestenclassic/repsample   Pod repsample-1 is Active Ready
    3m25s       Normal    StateChange              timestenclassic/repsample   TimesTenClassic was ActiveTakeover, now StandbyDown
    2m35s       Normal    Info                     timestenclassic/repsample   Pod repsample-0 Agent Up
    2m35s       Normal    Info                     timestenclassic/repsample   Pod repsample-0 Instance Exists
    2m35s       Normal    Info                     timestenclassic/repsample   Pod repsample-0 Daemon Down
    2m35s       Normal    Info                     timestenclassic/repsample   Pod repsample-0 Daemon Up
    2m35s       Normal    Info                     timestenclassic/repsample   Pod repsample-0 Database Unloaded
    2m32s       Normal    Info                     timestenclassic/repsample   Pod repsample-0 Database None
    2m11s       Normal    Info                     timestenclassic/repsample   Pod repsample-0 Database Loaded
    2m11s       Normal    Info                     timestenclassic/repsample   Pod repsample-0 RepAgent Not Running
    2m11s       Normal    Info                     timestenclassic/repsample   Pod repsample-0 RepScheme Exists
    2m11s       Normal    StateChange              timestenclassic/repsample   Pod repsample-0 RepState IDLE
    2m5s        Normal    Info                     timestenclassic/repsample   Pod repsample-0 Database Loaded
    2m5s        Normal    Info                     timestenclassic/repsample   Pod repsample-0 RepAgent Running
    2m5s        Normal    Info                     timestenclassic/repsample   Pod repsample-0 RepScheme Exists
    2m5s        Normal    StateChange              timestenclassic/repsample   Pod repsample-0 RepState STANDBY
    2m5s        Normal    StateChange              timestenclassic/repsample   Pod repsample-0 is Ready
    2m5s        Normal    Upgrade                  timestenclassic/repsample   Upgrade of active complete
    2m5s        Normal    Upgrade                  timestenclassic/repsample   Upgrade completed in 359 secs
    2m4s        Normal    StateChange              timestenclassic/repsample   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.

  6. Verify the active and standby databases are running the correct release.
    1. Establish a shell in the active Pod.
      kubectl exec -it repsample-1 -c tt -- /bin/bash
    2. Run the TimesTen ttVersion utility.
      ttVersion
      The output is similar to the following:
      TimesTen Release 22.1.1.35.0 (64 bit Linux/x86_64) (instance1:6624) 2025-01-16T15:16:01Z
        Instance admin: timesten
        Instance home directory: /tt/home/timesten/instances/instance1
        Group owner: timesten
        Daemon home directory: /tt/home/timesten/instances/instance1/info
        PL/SQL enabled.
      
    3. Exit from the shell.
    4. Establish a shell in the standby Pod.
      kubectl exec -it repsample-0 -c tt -- /bin/bash
    5. Run the TimesTen ttVersion utility.
      ttVersion
      The output is similar to the following:
      TimesTen Release 22.1.1.35.0 (64 bit Linux/x86_64) (instance1:6624) 2025-01-16T15:16:01Z
        Instance admin: timesten
        Instance home directory: /tt/home/timesten/instances/instance1
        Group owner: timesten
        Daemon home directory: /tt/home/timesten/instances/instance1/info
        PL/SQL enabled.
      
    6. Exit from the shell.
    The active and standby databases are running the correct release of TimesTen.

Congratulations! You successfully completed an automated upgrade for a replicated TimesTenClassic object. The active and standby databases are upgraded, running, and fully operational.