Purpose
You can use this statement as the sys tenant to initiate a compaction at the storage layer.
Syntax
alter_system_merge_stmt:
ALTER SYSTEM merge_action;
merge_action:
MAJOR FREEZE [tenant_list]
| MINOR FREEZE [tenant_list | replica] [server_list]
| {SUSPEND | RESUME} MERGE [tenant_list]
| CLEAR MERGE ERROR [tenant_list]
tenant_list:
TENANT [=] ALL | tenant_name_list
tenant_name_list:
tenant_name [, tenant_name ...]
replica:
TABLET_ID [=] tablet_id
server_list:
SERVER [=] ('ip:port' [, 'ip:port'...])
Parameters
| Parameter | Description |
|---|---|
| MAJOR FREEZE | Initiates a major compaction. You can use TENANT=ALL to initiate a major compaction for all tenants or use TENANT=tenant_name [, tenant_name ...] to initiate a major compaction only for specified tenants. |
| MINOR FREEZE | Initiates a minor compaction. |
| {SUSPEND | RESUME} MERGE | Suspends or resumes the major compaction. You can use TENANT=ALL to suspend or resume a major compaction for all tenants or use TENANT=tenant_name [, tenant_name ...] to suspend or resume a major compaction only for specified tenants. |
| CLEAR MERGE ERROR | Removes major compaction error tags. You can use TENANT=ALL to remove major compaction error tags for all tenants or use TENANT=tenant_name [, tenant_name ...] to remove major compaction error tags only for specified tenants. |
| tenant_name | The tenant on which a minor compaction is performed. |
| TABLET_ID | The partition on which a minor compaction is performed. |
| SERVER | The server on which a minor compaction is performed. |
Examples
Initiate a major compaction at the storage layer
Initiate a major compaction for the sys tenant.
obclient> ALTER SYSTEM MAJOR FREEZE; Query OK, 0 rows affectedInitiate a major compaction for all tenants.
obclient> ALTER SYSTEM MAJOR FREEZE TENANT = ALL; Query OK, 0 rows affectedInitiate a major compaction for
tenant1andtenant2.obclient> ALTER SYSTEM MAJOR FREEZE TENANT = tenant1,tenant2; Query OK, 0 rows affected
Initiate a minor compaction at the storage layer
Initiate a minor compaction for the sys tenant.
obclient> ALTER SYSTEM MINOR FREEZE; Query OK, 0 rows affectedInitiate a minor compaction for all tenants.
obclient> ALTER SYSTEM MINOR FREEZE TENANT = ALL; Query OK, 0 rows affectedInitiate a minor compaction for
tenant1andtenant2.obclient> ALTER SYSTEM MINOR FREEZE TENANT = tenant1,tenant2; Query OK, 0 rows affectedInitiate a minor compaction for a specified partition of
tenant1.obclient> ALTER SYSTEM MINOR FREEZE tenant = tenant1 tablet_id = 1100611139453887; Query OK, 0 rows affectedInitiate a minor compaction for a specified OBServer node.
obclient> ALTER SYSTEM MINOR FREEZE SERVER = ('10.XXX.XXX.XXX:2882'); Query OK, 0 rows affected
Suspend or resume a major compaction
Suspend a major compaction for all tenants.
obclient> ALTER SYSTEM SUSPEND MERGE TENANT = ALL; Query OK, 0 rows affectedSuspend a major compaction for
tenant1andtenant2.obclient> ALTER SYSTEM SUSPEND MERGE TENANT = tenant1,tenant2; Query OK, 0 rows affectedResume a major compaction for all tenants.
obclient> ALTER SYSTEM RESUME MERGE TENANT = ALL; Query OK, 0 rows affectedResume a major compaction for
tenant1andtenant2.obclient> ALTER SYSTEM RESUME MERGE TENANT = tenant1,tenant2; Query OK, 0 rows affected
Remove major compaction error tags
Remove major compaction error tags for all tenants.
obclient> ALTER SYSTEM CLEAR MERGE ERROR TENANT = ALL; Query OK, 0 rows affectedRemove major compaction error tags for
tenant1andtenant2.obclient> ALTER SYSTEM CLEAR MERGE ERROR TENANT = tenant1,tenant2; Query OK, 0 rows affected