2.8. Upgrading a Cluster #
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 that may cause issues for your application. You can proceed to upgrade if there are no potential issues.
The process of updating a Shardman consists of several steps that must be performed sequentially:
Upgrade Shardman packages.
Restart all Shardman services and database instances.
Upgrade database shardman extension.
2.8.1. Upgrade Packages #
2.8.1.1. APT-based Systems #
To upgrade packages, typically 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)'
2.8.1.2. RPM-based systems #
To upgrade packages, typically 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)'
2.8.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:
export SDM_STORE_ENDPOINTS=http://etcd1:2379,http://etcd2:2379,http://etcd3:2379 export SDM_CLUSTER_NAME=cluster0
2.8.3. Upgrade the Extension #
After restarting services of the cluster, you should update the server extensions by running the following command:
$
shardmanctl --cluster-name cluster0 --store-endpoints http://etcd1:2379,http://etcd2:2379,http://etcd3:2379 upgrade
In the case when the shardman extension version and server library version are different, distributed queries and Shardman DDL will not work.
Shardman extensions try to ensure that they do not communicate with incompatible software. Incompatibilities can arise for several reasons: the shardman shared library version does not match the extension version or the remote server version does not match the local server version. In case when the extension and library versions mismatch, Shardman cannot modify its metadata and will refuse to perform operations on global objects until the extension is updated. In case when the remote server version does not match the local server version or when they belong to different clusters, Shardman will refuse to communicate with the server.