Sync Variables
On this page
Sync variables are workspace-wide variables that you set on the master aggregator.Session that can also be set globally
) and persists if the affected nodes are restarted.
Types of Sync Variables
There are three types of sync variables:
-
Variables that can sync to all aggregators.
-
Variables that can sync to all leaves.
-
Variables that can sync to all nodes (leaves and aggregators).
The last sentence of the Description
column in the list of sync variables specifies each variable’s type.
Sync Variable Scopes
Every variable has one of the following scopes.
-
Global.
When you set a global variable, its value is effective for your current connection to the node and any other existing or subsequent connections, initiated by any user. -
Session that can also be set globally.
When set for the session, the variable’s value is effective for your current connection to the node. When set globally, this variable’s value is NOT effective for your current connection to the node but is effective for any other existing or subsequent connections to the node, initiated by any user.
Important
SingleStore recommends using a global setting for session variables whose values must be propagated to leaf nodes from the aggregator nodes on which the variable is set.
Most sync variables have global scope.session that can also be set globally
are indicated in the Description
column in the list of sync variables.
Note: Use the @@
selector to read the value of a variable.
Setting Sync Variables
Sync variables with global or session scope can be set globally in the following way.
-
Using a SingleStore Helios client, run one of the following three commands: run SET CLUSTER (the equivalent of SET GLOBAL) to sync a variable to all nodes or to all aggregators; run SET AGGREGATOR to sync a variable to all aggregators; run SET LEAF to sync a variable to all leaves.
Connecting to SingleStore
Caution
You can set a sync variable on the Master Aggregator only.
Last modified: June 5, 2024