This page describes how to upgrade a MemSQL cluster not managed by MemSQL Ops from pre-6.0 to MemSQL 6.0. If your MemSQL cluster is managed by MemSQL Ops, see Upgrading MemSQL to 6.0 instead.
Upgrading from pre-6.0 to MemSQL 6.0 is composed of two parts:
-
Upgrading individual nodes
-
Upgrading the cluster metadata
Individual nodes get upgraded when they are restarted with the new binaries. The cluster metadata requires a few manual steps to set up the aggregator metadata and upgrade the metadata location from the sharding
database to the cluster
database, which has a new method for replication and writing the log to disk.
The extra manual step consists of two phases:
-
BOOTSTRAP AGGREGATOR
on the master aggregator -
ADD AGGREGATOR
for every aggregator
It is very important that the sharding
database does not get deleted, despite the fact that it is deprecated. The upgrade procedure will archive it, so it is recoverable if a downgrade is required.
Plans in the plancache are dependent upon the MemSQL version, so when you upgrade to a new MemSQL version, all previously compiled plans will be invalidated.
This means that any queries run against the upgraded cluster will force a one time plan compilation, which results in slower query times the first time those queries are run. After the plans have been recompiled, they will be stored again in the plancache and query latency will return to nominal values.
Breakdown of the upgrade steps:
-
Restart all nodes with the new binaries. Note: After being restarted, none of the nodes will have a role (e.g. leaf/aggregator), instead they will exist in a state where they do not belong to a cluster.
-
Connect to the Master Aggregator and run:
BOOTSTRAP AGGREGATOR ‘host'[:port]
Info
It is important that the same memsql.cnf
file is maintained for the Master Aggregator, since the upgrade code uses the master_aggregator
global variable to determine whether it is safe to run BOOTSTRAP
or not. The Master Aggregator prior to upgrade must be the Master Aggregator on upgrade as it is the only node that is guaranteed to have the most up to date sharding
and reference databases.
After the `BOOTSTRAP AGGREGATOR` command completes, the cluster will consist of one Master Aggregator and the leaves. The leaves will get added to the cluster asynchronously. The sharding database on the leaves will get archived and the cluster database will get created as part of this asynchronous process.
- Connect to the Master Aggregator and run the following command for every aggregator in your cluster:
ADD AGGREGATOR user:'pw'@'host':port
When the aggregators get added, their sharding database gets archived and the cluster database gets created.
- The cluster has now been upgraded to MemSQL 6. See the instructions in Post-upgrade considerations.
Notes
Currently, online upgrade is not available between MemSQL 5.8 and MemSQL 6.0; however, online upgrade is available between versions of MemSQL 6.0.x. See Upgrading between MemSQL versions for more information.