The tenant's Global Timestamp Service (GTS) is carried by the tenant's system log stream and provides a global timestamp to all OBServer nodes under the tenant. Since its availability directly affects the entire tenant's availability, when there are many nodes in the cluster and QPS is high, it is necessary to isolate GTS traffic from user traffic to prioritize ensuring GTS response time.
This section describes how to scale out using UNIT_NUM and enable GTS exclusive mode to isolate GTS traffic from user traffic, thereby improving the stability of your business.
Background information
The current version supports the GTS exclusive feature, which is controlled by the tenant-level parameter enable_gts_standalone. It is disabled by default. You can enable the GTS exclusive feature as needed. Once enabled, the system will automatically ensure that the system log stream where GTS resides exclusively uses a set of Units.
Scenario information
Assume there is currently a tenant named tenant1 with a locality of F@zone1,F@zone2,A and primary zones zone1,zone2. The UNIT_NUM for both zone1 and zone2 is 2. The distribution of the tenant's log streams is shown in the following figure.

Procedure
In this scenario, when the machine hosting the SYS log stream reaches a bottleneck, to ensure business stability, you can first scale out the UNIT_NUM for all resource pools of the tenant from 2 to 3. Then, migrate and replicate the SYS log stream (log stream 1) to the newly added set of Units after scaling, so that log stream 1 exclusively uses a set of Units. Finally, enable GTS exclusive mode.
The specific steps are as follows:
Log in to the
systenant of the cluster as therootuser.Disable automatic rebalancing within the tenant.
Set the value of the tenant-level parameter enable_rebalance to
Falseto avoid triggering automatic rebalancing. The statement is as follows:obclient(root@sys)[(none)]> ALTER SYSTEM SET enable_rebalance = False TENANT = tenant1;(Optional) Before scaling, if the number of nodes in a zone is insufficient, add one node to each of zone1 and zone2 first.
For more information about how to add a node, see Add a node.
Adjust the
UNIT_NUMfor all resource pools of the tenant to 3.obclient(root@sys)[(none)]> ALTER RESOURCE TENANT tenant1 UNIT_NUM = 3;For more information about scaling out by adjusting
UNIT_NUM, see Scale tenants by adjusting the unit number.Modify the log stream.
Change the
UNIT_GROUP(for homogeneous zone mode) /UNIT_LIST(for heterogeneous zone mode) of the SYS log stream (log stream 1) for tenanttenant1to the newly added set of Units after scaling, so that log stream 1 can exclusively use a set of Units. The statement is as follows:Homogeneous zone modeHeterogeneous zone modeobclient(root@sys)[(none)]> ALTER SYSTEM MODIFY LS 1 UNIT_GROUP unit_group_id TENANT = tenant1;Here,
unit_group_idmust be replaced with theUNIT_GROUP_IDof the newly added unit after scaling out.obclient(root@sys)[(none)]> ALTER SYSTEM MODIFY LS 1 UNIT_LIST (unit_id1,unit_id2) TENANT = tenant1;Here,
unit_id1andunit_id2must be replaced with theUNIT_IDof the newly added units after scaling out.For more information about how to change a log stream, see Modify a log stream.
Enable the GTS standalone feature.
Set the tenant-level parameter enable_gts_standalone to
True, as shown in the following statement.obclient(root@sys)[(none)]> ALTER SYSTEM SET enable_rebalance = True TENANT = tenant1;Re-enable automatic balancing within the tenant.
Set the tenant-level parameter enable_rebalance to
Trueto re-enable automatic balancing, as shown in the following statement.obclient(root@sys)[(none)]> ALTER SYSTEM SET enable_rebalance = True TENANT = tenant1;
In this scenario, after scaling out the tenant's UNIT_NUM and enabling GTS standalone, the UNIT_NUM of user log streams remains unchanged. Only the SYS log stream (log stream number 1) is migrated and replicated. No balancing of log stream numbers or transfers occur, thereby ensuring the stability of user business. The final log stream distribution for the tenant is shown in the following figure.
