Taking Leaves Offline with Cluster Downtime
On this page
Steps for Offline Maintenance
Step 1: Prior to performing any offline maintenance, SingleStore recommends that you take a backup as a standard precautionary measure.
Step 2: Run the following commands from the master aggregator :
From the output of these commands, confirm that the following are true.
-
All leaves are online.
-
All aggregators are online.
-
There are no partitions with the “orphan” role.
REBALANCE or RESTORE REDUNDANCY commands need not be run.
Step 3: From the master aggregator, run the SNAPSHOT DATABASE command for each database.
Step 4: From the master aggregator, run the _ command for each database
This command makes sure that a snapshot is triggered on the replica and the replica also has a successful snapshot.
Step 5: Use sdb-admin stop-node to stop all the SingleStore nodes in the following sequence: first the master aggregator, then child aggregators, and finally the leaves.
If you are not able to stop the nodes in the specified order then you need to run SET GLOBAL leaf_ from the master aggregator before stopping the nodes.
Step 6: Perform the maintenance tasks on the hosts as required.
Step 7: Use sdb-admin start-node to start all the SingleStore nodes in the following sequence: first, the leaf nodes, then the child aggregators, and finally the master aggregator.
If you had turned leaf_ off in step 5, then run SET GLOBAL leaf_ from the master aggregator.
This procedure applies to self-managed deployments managed with SingleStore Tools.sdb-admin commands.
Taking Leaves Offline on Kubernetes with Cluster Downtime
Use this procedure only for clusters managed by the SingleStore Kubernetes Operator.
Prerequisites
-
Confirm that the cluster is healthy and that all required backups and maintenance approvals are complete.
-
Check the
MemsqlClusterphase:kubectl get memsql <cluster-name> -n <namespace> -o jsonpath="{.status.phase}" -
The phase must be Running.
-
Confirm that your most recent backup completed according to your backup policy.
Query the backup history from the MA: SELECT database_name, status, start_timestamp, end_timestampFROM information_schema.mv_backup_historyWHERE status = 'Success'ORDER BY start_timestamp DESC; -
Refer to MV_
BACKUP_ HISTORY for more information on columns.
-
-
Confirm that the availability zone has enough spare capacity to reschedule pods displaced from the node under maintenance, or that your cluster autoscaler can provision additional capacity on demand.
The exact verification steps depend on your Kubernetes environment and autoscaler configuration. -
Do not modify the
MemsqlClustercustom resource or change the Operator version during the maintenance window.The Operator can defer and replay specification changes, replace StatefulSets, or restart pods while the cluster is recovering.
Scale the Cluster Down
This procedure takes the cluster fully offline.
-
Scale the Operator deployment to zero replicas so that it does not reconcile the temporary
StatefulSetchanges during maintenance.kubectl scale deployment <operator-deployment> --replicas=0 -
Scale the node
StatefulSetsto zero replicas directly withkubectl; do not use theMemsqlClustercustom resource for this temporary maintenance operation.kubectl scale statefulset <statefulset-name> --replicas=0Repeat this for the Master Aggregator (MA), child aggregators, and leaf nodes in the order confirmed for your Operator version.
-
Perform the required host maintenance.
Bring the Cluster Back Online
-
Bring the MA
StatefulSetonline first usingkubectl.The Operator startup probe attaches nodes by querying the MA. The MA must be available before dependent nodes can start normally. kubectl scale statefulset <master-aggregator-statefulset> --replicas=<ma_count>Set
<ma_to the value ofcount> spec.in themasterAggregatorSpec. count MemsqlClusterresource: 1 for a single-MA cluster or 3 when MA HA (MA consensus) is enabled.For leaves and child aggregators, use the counts from spec.andleafSpec. count spec., respectively.aggregatorSpec. count -
Bring the
StatefulSetsback online in the following order:-
For redundancy level 2, scale both leaf
StatefulSets(one per availability group) tospec..leafSpec. count For redundancy level 1, scale the single leaf StatefulSet.kubectl scale statefulset <leaf-ag1-statefulset> --replicas=<leaf-count>kubectl scale statefulset <leaf-ag2-statefulset> --replicas=<leaf-count> -
Scale the child aggregator
StatefulSettospec..aggregatorSpec. count kubectl scale statefulset <child-aggregator-statefulset> --replicas=<ca-count> -
After the cluster is healthy, scale the Operator deployment back up:
kubectl scale deployment <operator-deployment> --replicas=1
-
Do not change the MemsqlCluster specification or the Operator version until recovery is complete and the cluster reports healthy.
Online Maintenance Alternative
For Kubernetes clusters, prefer an online maintenance workflow when the maintenance task permits it.NoSchedule taint evicts SingleStore pods from the tainted Kubernetes node, and the Operator reschedules them onto other Kubernetes nodes in the same AZ.
-
Confirm that spare capacity is available for pod rescheduling.
-
Apply a
NoScheduletaint to the Kubernetes node being maintained.Use the taint key and value appropriate for your environment. kubectl taint node <kubernetes-node-name> <key>=<value>:NoSchedule -
Trigger the Operator-managed rolling restart by updating an annotation under the node specification's
objectMetaOverrides.field.annotations Add this annotation to each spec section that contains nodes: masterAggregatorSpec,childAggregatorSpec, andleafSpec.To perform maintenance across all Kubernetes nodes in the cluster, add the annotation to all three sections so the Operator rolls each node type in turn. spec:masterAggregatorSpec:objectMetaOverrides:annotations:<restart-annotation-key>: "<unique-value>"childAggregatorSpec:objectMetaOverrides:annotations:<restart-annotation-key>: "<unique-value>"leafSpec:objectMetaOverrides:annotations:<restart-annotation-key>: "<unique-value>" -
Wait for the Operator-managed rollout to finish and verify that the cluster is healthy before removing the taint.
The Operator detects the spec change and performs a rolling restart of the affected pods, keeping the cluster online.maintenance-annotation-key and update its value for each maintenance run.
spec:leafSpec:objectMetaOverrides:annotations:maintenance-annotation-key: "2026-10-23-run-1"
For the next maintenance run, change the value (for example, to "2026-10-24-run-1") to trigger another rolling restart.
Last modified: