Upgrading the Database Protocol

A new version of NuoDB database software may introduce a new version of the database protocol. For new releases that introduce a new database protocol version, the database will not be upgraded to the new version until the database protocol version is upgraded.

Changes to the database protocol are sometimes necessary to support new features or fix issues. The version of the database protocol used by the database processes is stored in the NuoDB Archive so that when a new database is started, the processes know which protocol to communicate with.

Upgrading the Database Protocol Instructions

Before the database protocol can be upgraded, all of the database hosts must have the new software version installed. If all of the existing database processes have not been upgraded to the new software version, the show database-versions command returns "Available Versions: ” with no versions following it.

Confirming Whether a new Database Protocol Version is Available

After upgrading database software, it may be necessary to upgrade the database protocol. To confirm whether a new database protocol version is available, run the show database-versions command.

nuocmd show database-versions --db-name <dbname>

When there is a mix of old and new versions of database processes, this is displayed in the output for show database-versions. For example:

nuocmd show database-versions --db-name test
effective version ID: 1245184, effective version: 3.4, max version ID: 1245184
Available versions:
Process versions:
  version ID: 1245184, version: 3.4, release: 3.4.3-1-9e6ec78560
    [SM] sm1/192.168.16.4:48006 [start_id = 0] [server_id = nuoadmin0] [pid = 41] [node_id = 1] [last_ack =  1.19] MONITORED:RUNNING
    [SM] sm2/192.168.16.5:48006 [start_id = 1] [server_id = nuoadmin1] [pid = 38] [node_id = 2] [last_ack =  1.18] MONITORED:RUNNING
    [TE] te2/192.168.16.8:48006 [start_id = 3] [server_id = nuoadmin1] [pid = 38] [node_id = 4] [last_ack =  1.19] MONITORED:RUNNING
  version ID: 1310720, version: 4.0, release: 4.0-1-2f01499300
    [TE] te1/192.168.16.6:48006 [start_id = 4] [server_id = nuoadmin0] [pid = 40] [node_id = 5] [last_ack =  2.09] MONITORED:RUNNING

When all processes are up-to-date with the latest version, but the effective database version has not been explicitly upgraded, this is displayed in the output for show database-versions. For example:

nuocmd show database-versions --db-name test
effective version ID: 1245184, effective version: 3.4, max version ID: 1310720
Available versions:
  version ID: 1310720, version: 4.0
Process versions:
  version ID: 1310720, version: 4.0, release: 4.0-1-2f01499300
    [TE] te1/192.168.16.6:48006 [start_id = 4] [server_id = nuoadmin0] [pid = 40] [node_id = 5] [last_ack =  8.40] MONITORED:RUNNING
    [TE] te2/192.168.16.7:48006 [start_id = 5] [server_id = nuoadmin1] [pid = 39] [node_id = 6] [last_ack =  8.40] MONITORED:RUNNING  
    [SM] sm1/192.168.16.4:48006 [start_id = 6] [server_id = nuoadmin0] [pid = 40] [node_id = 7] [last_ack = 10.23] MONITORED:RUNNING
    [SM] sm2/192.168.16.5:48006 [start_id = 7] [server_id = nuoadmin1] [pid = 40] [node_id = 8] [last_ack =  2.80] MONITORED:RUNNING

Upgrading to a new Database Protocol

To upgrade to a new database protocol, run the upgrade database-version command.

Upgrading to a Specific Version

To upgrade the database to a specific version, include the --version option. For example, to upgrade your database to NuoDB 4.0, run the following command:

nuocmd upgrade database-version --version 4.0

Upgrading to the Latest Version Available

To upgrade the database to a specific version, include the --max-version option. For example:

nuocmd upgrade database-version --max-version

Unless there is an error, the upgrade database-version command generates no output.

Note: After the database protocol version has been upgraded, the NuoDB Archive cannot be used with a previous NuoDB software version that only supports the previous database protocol version. As a result, downgrading after the database protocol version will require restoring a backup of the database. For more information on downgrading, see Downgrading to a Previous Release.

To confirm that all processes have been upgraded to the latest version available, run the show database-versions command again.

nuocmd show database-versions --db-name test
effective version ID: 1310720, effective version: 4.0, max version ID: 1310720
Available versions:
Process versions:
  version ID: 1310720, version: 4.0, release: 4.0-1-2f01499300
    [TE] te1/192.168.0.7:48006 [start_id = 4] [server_id = nuoadmin0] [pid = 39] [node_id = 5] [last_ack =  8.48] MONITORED:RUNNING
    [TE] te2/192.168.0.8:48006 [start_id = 5] [server_id = nuoadmin1] [pid = 40] [node_id = 6] [last_ack =  5.41] MONITORED:RUNNING
    [SM] sm1/192.168.0.4:48006 [start_id = 6] [server_id = nuoadmin0] [pid = 39] [node_id = 7] [last_ack =  2.73] MONITORED:RUNNING
    [SM] sm2/192.168.0.5:48006 [start_id = 7] [server_id = nuoadmin1] [pid = 40] [node_id = 8] [last_ack =  8.16] MONITORED:RUNNING

Note: The show database-versions and upgrade database-version commands are run using NuoDB Command (nuocmd). For information on using NuoDB Command and other NuoDB command line utilities, see Command Line Tools.