Chapter 38. Rolling Upgrades

38.1. Rolling Upgrades

Rolling upgrades of Red Hat JBoss Data Grid enable clusters to upgrade to new versions without downtime. Nodes are upgraded without the need to restart the application or risk of data loss.

JBoss Data Grid supports rolling upgrades in Remote Client-Server mode only.

In earlier releases, JBoss Data Grid allowed you to perform rolling upgrades using the REST interface. As of 7.2, JBoss Data Grid supports rolling upgrades using Hot Rod only.

Important

To ensure data consistency, you should ensure that cache entries in the source cluster are not updated during the rolling update.

38.2. Performing Rolling Upgrades Using Hot Rod

The following process is used to perform rolling upgrades on Red Hat JBoss Data Grid running in Remote Client-Server mode using Hot Rod. This procedure is designed to upgrade the data grid itself and does not upgrade the client application.

Important

Ensure that the correct version of the Hot Rod protocol is used with your JBoss Data Grid version. This version must be specified on the client programmatically. Refer to the Developer Guide for instructions on defining the client version.

Hot Rod protocol versions for each JBoss Data Grid release are as follows:

  • JBoss Data Grid 7.2 requires Hot Rod protocol version 2.6
  • JBoss Data Grid 7.1 requires Hot Rod protocol version 2.5
  • JBoss Data Grid 7.0 requires Hot Rod protocol version 2.5
  • JBoss Data Grid 6.6 requires Hot Rod protocol version 2.3
  • JBoss Data Grid 6.5 requires Hot Rod protocol version 2.0
  • JBoss Data Grid 6.4 requires Hot Rod protocol version 2.0
  • JBoss Data Grid 6.3 requires Hot Rod protocol version 2.0
  • JBoss Data Grid 6.2 requires Hot Rod protocol version 1.3
  • JBoss Data Grid 6.1 requires Hot Rod protocol version 1.2

Prerequisite

This procedure assumes that a cluster is already configured and running, and that it is using an older version of JBoss Data Grid. This cluster is referred to below as the Source Cluster and the Target Cluster refers to the new cluster to which data will be migrated.

  1. Configure the Target Cluster

    Use either different network settings or a different JGroups cluster name to set the Target Cluster (consisting of nodes with new JBoss Data Grid) apart from the Source Cluster. For each cache, configure a RemoteCacheStore with the following settings:

    1. Ensure that remote-server points to the Source Cluster.
    2. Ensure that the cache name matches the name of the cache on the Source Cluster.
    3. Ensure that hotrod-wrapping is enabled (set to true).
    4. Ensure that purge is disabled (set to false).
    5. Ensure that passivation is disabled (set to false).

      Figure 38.1. Configure the Target Cluster with a RemoteCacheStore

      1460
    Note

    See the $JDG_HOME/docs/examples/configs/[path]standalone-hotrod-rolling-upgrade.xml file for a full example of the Target Cluster configuration for performing Rolling Upgrades.

  2. Start the Target Cluster

    Start the Target Cluster’s nodes. Configure each client to point to the Target Cluster instead of the Source Cluster. Eventually, the Target Cluster handles all requests instead of the Source Cluster. The Target Cluster then lazily loads data from the Source Cluster on demand using the RemoteCacheStore.

    Figure 38.2. Clients point to the Target Cluster with the Source Cluster as RemoteCacheStore for the Target Cluster.

    1461
  3. Dump the Source Cluster keyset

    When all connections are using the Target Cluster, the keyset on the Source Cluster must be dumped. This can be done using either JMX or the CLI:

    1. JMX

      Invoke the recordKnownGlobalKeyset operation on the RollingUpgradeManager MBean on the Source Cluster for every cache that must be migrated.

    2. CLI

      Invoke the upgrade --dumpkeys command on the Source Cluster for every cache that must be migrated, or use the --all switch to dump all caches in the cluster.

  4. Fetch remaining data from the Source Cluster

    The Target Cluster fetches all remaining data from the Source Cluster. Again, this can be done using either JMX or CLI:

    1. JMX

      Invoke the synchronizeData operation and specify the hotrod parameter on the RollingUpgradeManager MBean on the Target Cluster for every cache that must be migrated.

    2. CLI

      Invoke the upgrade --synchronize=hotrod command on the Target Cluster for every cache that must be migrated, or use the --all switch to synchronize all caches in the cluster.

  5. Disabling the RemoteCacheStore

    Once the Target Cluster has obtained all data from the Source Cluster, the RemoteCacheStore on the Target Cluster must be disabled. This can be done as follows:

    1. JMX

      Invoke the disconnectSource operation specifying the hotrod parameter on the RollingUpgradeManager MBean on the Target Cluster.

    2. CLI

      Invoke the upgrade --disconnectsource=hotrod command on the Target Cluster.

  6. Decommission the Source Cluster

    As a final step, decommission the Source Cluster.

38.3. RollingUpgradeManager Operations

The RollingUpgradeManager Mbean handles the operations that allow data to be migrated from one version of Red Hat JBoss Data Grid to another when performing rolling upgrades. The RollingUpgradeManager operations are:

  • recordKnownGlobalKeyset retrieves the entire keyset from the cluster running on the old version of JBoss Data Grid.
  • synchronizeData performs the migration of data from the Source Cluster to the Target Cluster, which is running the new version of JBoss Data Grid.
  • disconnectSource disables the Source Cluster, the older version of JBoss Data Grid, once data migration to the Target Cluster is complete.

38.4. RemoteCacheStore Parameters for Rolling Upgrades

38.4.1. rawValues and RemoteCacheStore

By default, the RemoteCacheStore store’s values are wrapped in InternalCacheEntry. Enabling the rawValues parameter causes the raw values to be stored instead for interoperability with direct access by RemoteCacheManagers.

rawValues must be enabled in order to interact with a Hot Rod cache via both RemoteCacheStore and RemoteCacheManager.

38.4.2. hotRodWrapping

The hotRodWrapping parameter is a shortcut that enables rawValues and sets an appropriate marshaller and entry wrapper for performing Rolling Upgrades.