4.7. Upgrade a Cluster

4.7.1. Upgrade packages
4.7.2. Restart Shardman services and database instances
4.7.3. Upgrade extension

This section discusses how to upgrade your database from one Shardman release to a newer one. It is best to review the Release notes before an upgrade and look for any changes which may cause problems for your application. You can proceed to upgrade if there are no potential problems.

The process of updating a Shardman consists of several steps that must be performed sequentially:

4.7.1. Upgrade packages

4.7.1.1. Apt based systems

To upgrade packages run the following command:

$ apt update && apt --only-upgrade install shardman-tools shardman-services postgrespro-sdm-14-contrib postgrespro-sdm-14-server

or upgrade all packages:

$ apt update && apt upgrade

Check that all packages have been updated on each node:

$ dpkg -l | grep -E  '(postgrespro|shardman)'

4.7.1.2. RPM based systems

To upgrade packages run the following command:

$ yum update shardman-tools shardman-services postgrespro-sdm-14-contrib postgrespro-sdm-14-server

or upgrade all packages:

$ yum update

Check that all packages have been updated on each node:

$ yum list --installed | grep -E  '(postgrespro|shardman)'

4.7.2. Restart Shardman services and database instances

After updating the packages, you need to restart all cluster services. It can be done with a single shardmanctl restart command:

$ shardmanctl --cluster-name cluster0 --store-endpoints http://etcd1:2379,http://etcd2:2379,http://etcd3:2379 restart

You can skip the --cluster-name and --store-endpoints options by setting the SDM_CLUSTER_NAME and SDM_STORE_ENDPOINTS environment variables as in the example below:

4.7.3. Upgrade extension

After restarting services of the cluster, you should update the server extensions by calling the following command:

$ shardmanctl --cluster-name cluster0 --store-endpoints http://etcd1:2379,http://etcd2:2379,http://etcd3:2379 upgrade

In the case when shardman extension version and server library version are different, distributed queries and Shardman DDL won't work.

Shardman extensions try to ensure that they don't communicate with incompatible software. Incompatibilities can arise from several sources: shardman shared library version doesn't match extension version and remote server version doesn't match local server version. In case when extension and library version mismatch Shardman can't modify its metadata and will refuse to perform operations on global objects until extension is updated. In case when a remote server version doesn't match local server version or when they belong to different clusters Shardman will refuse to communicate to the server.