Upgrade to SingleStoreDB 7.6
Notice
SingleStoreDB betas and release candidates cannot be upgraded unless explicitly stated in the release notes.
Caution
As of SingleStoreDB 7.0, more disk space is required than with MemSQL 6.x for columnstore tables and the new replication mechanism, and introduces additional metadata for columnstore tables to improve performance for concurrent updates/deletes and selective filtering. Specifically:
An
auto-incr
value for every row has been introduced, which is persisted in blobs and requires approximately 8 bytes per columnstore row.Database logs are now pre-allocated as of SingleStoreDB 7.0:
Each
system
database requires an additional 32MB of disk space for pre-allocated log space. This equates to an additional 96MB per node.Each reference (
ref
) database requires two pre-allocated log files. The size of each log file is 64MB, for a total of 128MB of disk space perref
database per node. See the Sync Variables Lists for more information on changing theref
database log file size via thelog_file_size_ref_dbs
global variable.Each partition now requires two pre-allocated log files. The size of each log file is 256MB, for a total of 512MB of disk space for pre-allocated log space. See the Sync Variables Lists for more information on changing the partition log file size via the
log_file_size_partitions
global variable.Logs will require (
snapshot_trigger_size
*snapshots_to_keep
) of space over time (approximately), or about 4GB per partition using the default values of these variables. Customers are recommended to have twice this amount of disk space available for long-term log storage. See the Sync Variables Lists for more information onsnapshot_trigger_size
andsnapshots_to_keep
.WARNING: Changing the log file size will not affect existing databases. Reducing the size of existing log files or allocating new ones will have random and severe performance impacts on your workload when new log files need to be allocated.
If any host in the cluster is near or at disk capacity, please increase available storage before upgrading to SingleStoreDB 7.6. Similarly, a newly deployed SingleStoreDB 7.6 cluster will consume more disk space than a MemSQL 6.8 cluster running the same workload.
This topic describes how to upgrade SingleStoreDB to 7.6. Please read the following information thoroughly before upgrading to SingleStoreDB 7.6.
After you have finished upgrading, please see the Post-Upgrade Considerations section for additional information on behavioral changes that you should be aware of.
Important notes about upgrading
If upgrading from a version earlier than 7.0, please note the following.
Upgrade duration and behavior
Anticipate a longer upgrade time for each node. At the end of the upgrade process, anticipate a multi-minute delay while final checks are run that ensure the upgrade completed successfully and the cluster is ready for operation. If you connect to the cluster while these post-upgrade checks are running, you will receive an error that the upgrade is still in progress.
Compound keys
In compound keys with the UNIQUE
constraint, if the type of the first column of the key is specified as NOT NULL
, that resulted in non-standard UNIQUE
constraint behavior for any NULL
-able columns in that same compound key. This behavior has been changed as of SingleStoreDB 7.0 to treat all columns the same, independent of position in the key, conforming to the SQL standard.
Delete performance
SingleStoreDB 7.0 introduced row-level locking for columnstore update/delete so it can handle more concurrent queries, but for certain scenario it may cause performance degradation (delete on wide table with json column). Set COLUMNSTORE_TABLE_LOCK_THRESHOLD to bypass row-level locking and obtain the previous behavior.
Leaf nodes
In MemSQL 6.x, a leaf node can restart, come back online, and its databases can be queried when the Master Aggregator is offline. As of SingleStoreDB 7.0, a leaf node can restart and recover its databases, but it won’t bring them online unless the Master Aggregator is online. In all versions of SingleStoreDB, leaf nodes can safely be restarted when the Master Aggregator is online.
Plancache
Plans in the plancache are dependent upon the specific SingleStoreDB patch version, so when you upgrade to a new SingleStoreDB 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.
Replication
Replication is now synchronous as of SingleStoreDB 7.0 by default. Fail-overs in SingleStoreDB 7.6 will not occur unless a replica is in sync with its master. While you will never lose data on fail-overs, you could lose availability if your replicas are out of sync and a node goes down. Refer to Replication and Durability Concepts and Replay Error Handling for more information.
SCHEMA_BINDING
for Views
As of SingleStoreDB 7.0, SCHEMA_BINDING
for views is off by default. Prior to SingleStoreDB 7.0, SCHEMA_BINDING
for views was on by default. As a result, an error will no longer be issued when deleting a table under a view.
Note that this behavior only applies to views that are created after upgrading, and does not apply to views that were created prior to upgrading.
Snapshots
As of SingleStoreDB 7.0, the default value of snapshot_trigger_size
has been increased from 256MB to 2GB. This will not be updated automatically on upgrade, and it is recommended that customers make this change post-upgrade to reduce snapshot disk I/O.
Sync variables
As of SingleStoreDB 7.0, a large percentage of system variables have been changed to “sync” variables. This allows variables to be set on the Master Aggregator, which will then persist and be replicated to the other nodes in the cluster. This obviates the need to manually set these variables in a .cnf
file. Use SHOW _SYNC VARIABLES
to see the current set of sync variables.
As a consequence of this, when a variable has been changed to a sync variable and has different values on two nodes (for example, a sync variable on Node X has been set to value A
, and this sync variable on Node Y has been set to value B
), the upgrade will issue a warning, and these variables must be reconciled before they can become sync variables.
To do so, manually update the .cnf
file and, using the above example, set the value of the sync variable to either A
or B
on both nodes. Next, run UPGRADE VARIABLES
on the Master Aggregator to enable all the new sync variables. Refer to Engine Variables and update-config for more information.
Non-Sync Variables
convert_nonunique_hash_to_skiplist
is set to TRUE
by default in SingleStoreDB 7.6. This means that any non-unique hash index will be recovered as a skiplist index, any newly created table will also have its non-unique hash indexes created as skiplists. For more information about this engine variable see the Non-Sync Variables List.
Verify your cluster is ready for upgrade
Warning
Only clusters that are running SingleStoreDB 7.0 and later can upgrade directly to SingleStoreDB 7.6.
If upgrading from SingleStoreDB 7.0 and later with DR clusters created via Replication, we recommend that you upgrade your DR secondary cluster(s) one at a time, and then upgrade your primary cluster last so that replication will continue to work after each upgrade.
To upgrade from MemSQL 6.7 or 6.8, we recommend a two-step upgrade process:
To upgrade from MemSQL 6.0 or earlier, we recommend a three-step upgrade process:
Use this guide to upgrade to SingleStoreDB 7.6
Prior to upgrading your cluster, it is recommended that you take a backup as a standard precautionary measure. See Back Up and Restore Data.
In addition, from the master aggregator, run the following commands:
SHOW LEAVES; SHOW AGGREGATORS; SHOW CLUSTER STATUS; EXPLAIN RESTORE REDUNDANCY; EXPLAIN REBALANCE PARTITIONS;
With the output of these commands, confirm that the following are true:
All leaves are online
All aggregators are online
There are no partitions with “Orphan” role
No Rebalance or restore redundancy is necessary
After you have backed up your data and verified your cluster is ready, you are ready to upgrade your cluster to the latest version of SingleStoreDB using the SingleStoreDB management tools.
Upgrade versions and methods
The tables below depict which versions of SingleStoreDB can be upgraded to SingleStoreDB 7.6 and the method by which the cluster can be upgraded.
Offline upgrade: Your SingleStoreDB cluster will be shut down and restarted over the course of the upgrade
Online upgrade: Your SingleStoreDB cluster will not be shut down over the course of the upgrade
Upgrade via SingleStoreDB Toolbox
Upgrade from | Offline upgrade | Online upgrade |
---|---|---|
7.0 | ✔ | From 7.0.16+ |
Step 1: Upgrade SingleStore Tools
To upgrade to SingleStoreDB 7.6, you must have singlestoredb-toolbox
1.11.3 or later installed prior to the SingleStoreDB upgrade process. It is recommended that you use the latest version of singlestoredb-toolbox
when upgrading your cluster.
Run the install
command to either install singlestoredb-toolbox
if it is not already installed, or upgrade an existing version of singlestoredb-toolbox
to the latest version of the package.
RHEL/CentOS
sudo yum install singlestoredb-toolbox -y
Debian
sudo apt install singlestoredb-toolbox -y
Upgrade without Internet access
If your cluster does not have internet access, use one of the following buttons to download either the latest RPM or Debian singlestoredb-toolbox
package to a location accessible by your cluster:
Then, run the install
command for the installed package manager and specify the path to the package.
RHEL/CentOS
sudo yum install /path/to/singlestoredb-toolbox.rpm -y
Debian
sudo apt install /path/to/singlestoredb-toolbox.deb -y
Now you are ready to upgrade SingleStoreDB.
Step 2: Upgrade SingleStoreDB
The simplest and preferred upgrade option is an offline cluster upgrade. It is the least error-prone and easiest to execute; however, it requires downtime as all of the nodes in the cluster will be upgraded at the same time, shutting down the entire cluster for the duration of the upgrade.
If the cluster is running with High Availability, you also have the option to perform an incremental online cluster upgrade, which maintains cluster availability throughout the upgrade process. See the instructions in the Online upgrade section for more details.
Option 1: Offline upgrade
Note: Using this method to upgrade to SingleStoreDB 7.6 is referred to as an “offline” upgrade as your SingleStoreDB cluster will be shut down and restarted over the course of the upgrade. Do not shut down your cluster prior to starting the upgrade. If the cluster or individual nodes are offline when the upgrade is started, the upgrade will fail.
Execute the following command to start an offline upgrade.
Confirm that the cluster can be upgraded. The cluster will not be upgraded when running this command.
sdb-deploy upgrade --precheck-only
Upgrade your cluster.
Note:
sdb-deploy upgrade
will perform a snapshot of all databases prior to upgrade.sdb-deploy upgrade --version 7.6
If you do not specify a patch version, your cluster will be upgraded to the latest patch version of SingleStoreDB 7.6.
During the upgrade process, you will be prompted to enable synchronous replication on your existing databases, or to leave those databases using the previous asynchronous replication behavior.
Synchronous replication is enabled by default on all new 7.6 databases and provides an extra layer of resiliency in clusters with high availability enabled.
Note: You cannot downgrade from your current version.
If your cluster does not have internet access, use one of the following buttons to download either the latest RPM or Debian singlestoredb-server
package to a location accessible by your cluster:
The singlestoredb-server
package contains both the SingleStoreDB binary and the low-level management tool, memsqlctl
.
Run the sdb-deploy upgrade
command and reference the appropriate package in the --file-path
argument. Running upgrade
(as opposed to simply upgrading the package via the package manager) will perform an offline restart of all the nodes to make sure the cluster is using the new version.
RHEL/CentOS
sdb-deploy upgrade --file-path /path/to/singlestoredb-server.rpm
Debian
sdb-deploy upgrade --file-path /path/to/singlestoredb-server.deb
Refer to sdb-deploy upgrade for more information.
Once you have finished upgrading all of your nodes, see Post-upgrade considerations for any changes between versions that may impact your cluster.
Option 2: Online upgrade
This upgrade method is referred to as an “online” upgrade as your SingleStoreDB cluster will not be shut down over the course of the upgrade. Nodes will be restarted in a specific sequence to ensure that DML-based workloads will still function. Do not shut down your cluster prior to starting the upgrade. If the cluster or individual nodes are offline when the upgrade is started, the upgrade will fail.
Notice
An online upgrade may fail if a long-running workload that writes to the database, or a workload that manipulates SingleStoreDB files (such as an automated backup or maintenance script), is running on the target cluster. We recommend performing an online upgrade only after these workloads have completed.
Toolbox 1.11.7 and later provide the option to retry a failed online upgrade. Should the online upgrade ultimately fail, an offline upgrade will be attempted. Note that the cluster will be shut down and restarted over the course of an offline upgrade.
Execute the following command to start an online upgrade.
Confirm that the cluster can be upgraded. The cluster will not be upgraded when running this command.
sdb-deploy upgrade --precheck-only
Upgrade your cluster.
Note:
sdb-deploy upgrade
will perform a snapshot of all databases prior to upgrade.sdb-deploy upgrade --online --version 7.6
By specifying --version
, your cluster will be upgraded to the latest patch version of SingleStoreDB 7.6.
During the upgrade process, you will be prompted to enable synchronous replication on your existing databases. While asynchronous replication can still be chosen, the data replication mechanism as of SingleStoreDB 7.0 has been enhanced to the point where synchronous replication is now the recommended choice.
Note: You cannot downgrade from your current version.
If your cluster does not have internet access, use one of the following buttons to download either the latest RPM or Debian singlestoredb-server
package to a location accessible by your cluster:
The singlestoredb-server
package contains both the SingleStoreDB binary and the low-level management tool, memsqlctl
.
Run the sdb-deploy upgrade --online
command and reference the appropriate package in the --file-path
argument. Running upgrade
(as opposed to simply upgrading the package via the package manager) will perform an offline restart of all the nodes to make sure the cluster is using the new version.
RHEL/CentOS
sdb-deploy upgrade --online --file-path /path/to/singlestoredb-server.rpm
Debian
sdb-deploy upgrade --online --file-path /path/to/singlestoredb-server.deb
Refer to sdb-deploy upgrade for more information.
Once you have finished upgrading all of your nodes, see Post-upgrade considerations for any changes between versions that may impact your cluster.
Post-upgrade considerations
When upgrading to SingleStoreDB 7.6, you should be aware of the following changes to system behavior or default configuration settings. The behavior of a cluster upgraded from an earlier version to SingleStoreDB 7.6 may differ compared to a newly installed cluster on SingleStoreDB 7.6 as described below. Most of the changes fall into two categories:
In some versions, the default value for a configuration variable was changed compared to previous versions, but clusters upgraded from earlier versions retain their previous setting, both if it was set to a specific value or if it was not explicitly set and hence using the previous default. In some of these cases, it is recommended to update your configuration to the new default if you were previously using the old default, after appropriate testing.
Some new features are automatically enabled by default on newly installed SingleStoreDB 7.6 clusters but not automatically enabled on clusters upgraded from an earlier version to 7.6. In some of these cases, it is recommended to enable the new features, after appropriate testing.
Upgrades to 7.6
To reduce your Total Cost of Ownership (TCO), you may be able store data in Universal Storage instead of rowstores. This is because rowstores store their data in RAM, which can be costly. Universal Storage now supports upserts, which were previously only supported in rowstores.
You may want to run the command REBALANCE ALL DATABASES. This command rebalances each database in the cluster, in alphabetical order of the database name. When a rebalance runs on a database
d
, it first considers the placement of the partitions of the other databases in the cluster before rebalancing the partitions ofd
.You may want to set the
cardinality_estimation_level
engine variable to'7.3'
; this setting uses sampling and histograms together (when both are available), to improve selectivity estimation. (The default setting is'7.1'
).Changing the value of the
data_conversion_compatibility_level
engine variable can change the behavior of expressions in computed columns. Refer to the Data Type Conversion section of Data Types for more information.sp_query_dynamic_param
should be turned off if an application breaks post-upgrade due to a change in type conversion behavior. See the Example: Changes in Type Conversion Behavior for more information.Upgrading the cluster, with
json_extract_string_collation
set toauto
(default setting), changes the collation settings forJSON_EXTRACT_STRING
fromjson
toserver
. Refer to In-Depth Variable Definitions for information onjson_extract_string_collation
settings.