After a partition balancing task is triggered, you can view the execution status of the task in the view.
View the partition balancing tasks in the background for the sys tenant
Log in to the
systenant of the cluster as therootuser.The following is a connection example. Adjust the connection details according to your actual environment when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AExecute the following statement to view the partition balancing tasks in the background for the specified tenant.
View the partition balancing tasks in the background for the specified tenant.
The
CDB_OB_BALANCE_JOBSview displays the macro-level balancing tasks currently being executed for all tenants, including scaling out, scaling in, migration balancing, and partition balancing tasks.obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.CDB_OB_BALANCE_JOBS WHERE TENANT_ID = 1002 AND JOB_TYPE = 'PARTITION_BALANCE';The query result is as follows:
+-----------+--------+----------------------------+----------------------------+---------------------------------+-------------------+-----------------+-------------------------+--------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ | TENANT_ID | JOB_ID | CREATE_TIME | MODIFY_TIME | BALANCE_STRATEGY | JOB_TYPE | TARGET_UNIT_NUM | TARGET_PRIMARY_ZONE_NUM | STATUS | COMMENT | MAX_END_TIME | ZONE_UNIT_NUM_LIST | PARAMETER_LIST | +-----------+--------+----------------------------+----------------------------+---------------------------------+-------------------+-----------------+-------------------------+--------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ | 1002 | 374412 | 2024-06-14 14:39:38.710194 | 2024-06-14 14:39:38.710194 | partition attribution alignment | PARTITION_BALANCE | NULL | 1 | DOING | NULL | NULL | zone1:1 | ls_scale_out_factor:1,enable_rebalance:true,enable_transfer:true,enable_gts_standalone:false | +-----------+--------+----------------------------+----------------------------+---------------------------------+-------------------+-----------------+-------------------------+--------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ 1 row in setFor more information about the fields in the
CDB_OB_BALANCE_JOBSview, see CDB_OB_BALANCE_JOBS.View the log stream-level partition balancing tasks being executed in the specified tenant.
The
CDB_OB_BALANCE_TASKSview displays all log stream-level tasks currently being executed for all tenants, including log stream split (LS_SPLIT), log stream merge (LS_MERGE), log stream transfer (LS_TRANSFER), and log stream attribute modification (LS_ALTER).obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.CDB_OB_BALANCE_TASKS WHERE TENANT_ID = 1002 AND BALANCE_STRATEGY LIKE '%partition%';The query result is as follows:
+-----------+---------+----------------------------+----------------------------+-------------+--------+---------+---------------------------------------------------------------------------------------------------+--------------------+------------+---------------------+-------------+----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ | TENANT_ID | TASK_ID | CREATE_TIME | MODIFY_TIME | TASK_TYPE | SRC_LS | DEST_LS | PART_LIST | FINISHED_PART_LIST | PART_COUNT | FINISHED_PART_COUNT | LS_GROUP_ID | STATUS | PARENT_LIST | CHILD_LIST | CURRENT_TRANSFER_TASK_ID | JOB_ID | COMMENT | BALANCE_STRATEGY | +-----------+---------+----------------------------+----------------------------+-------------+--------+---------+---------------------------------------------------------------------------------------------------+--------------------+------------+---------------------+-------------+----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ | 1002 | 374414 | 2024-06-14 14:39:38.710194 | 2024-06-14 14:39:42.356430 | LS_TRANSFER | 1002 | 1001 | 500224:500224,500229:500229,500234:500234,500239:500239,500244:500244,500249:500249,500254:500254 | NULL | 7 | 0 | 1001 | TRANSFER | | 374415 | 3 | 374412 | | partition attribution alignment | | 1002 | 374415 | 2024-06-14 14:39:38.710194 | 2024-06-14 14:39:38.710194 | LS_ALTER | 1002 | -1 | NULL | NULL | 0 | 0 | 0 | INIT | 374414 | NULL | -1 | 374412 | NULL | partition attribution alignment | +-----------+---------+----------------------------+----------------------------+-------------+--------+---------+---------------------------------------------------------------------------------------------------+--------------------+------------+---------------------+-------------+----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ 2 rows in setFor more information about the fields in the
CDB_OB_BALANCE_TASKSview, see CDB_OB_BALANCE_TASKS.View the tablet-level partition balancing tasks being executed for the specified tenant.
The
CDB_OB_TRANSFER_TASKSview displays all tablet-level tasks currently being executed for all tenants, showing which partitions and Tablets of each tenant are being transferred.obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.CDB_OB_TRANSFER_TASKS WHERE TENANT_ID = 1002\GThe query result is as follows:
*************************** 1. row *************************** TENANT_ID:1002 TASK_ID: 3 CREATE_TIME: 2024-06-14 14:39:42.356430 MODIFY_TIME: 2024-06-14 14:38:44.315350 SRC_LS: 1002 DEST_LS: 1001 PART_LIST: 500224:500224,500229:500229,500234:500234,500239:500239,500244:500244,500249:500249,500254:500254 PART_COUNT: 7 NOT_EXIST_PART_LIST: NULL LOCK_CONFLICT_PART_LIST: NULL TABLE_LOCK_TABLET_LIST: NULL TABLET_LIST: 200089:0,200090:0,200091:0,200092:0,200093:0,200094:0,200095:0,1152921504606847076:0,1152921504606847077:0,1152921504606847078:0,1152921504606847079:0,1152921504606847080:0,1152921504606847081:0,1152921504606847082:0,1152921504606847083:0,1152921504606847084:0,1152921504606847085:0,1152921504606847086:0,1152921504606847087:0,1152921504606847088:0,1152921504606847089:0,1152921504606847090:0,1152921504606847091:0,1152921504606847092:0,1152921504606847093:0,1152921504606847094:0,1152921504606847095:0,1152921504606847096:0,1152921504606847097:0,1152921504606847098:0,1152921504606847099:0,1152921504606847100:0,1152921504606847101:0,1152921504606847102:0,1152921504606847103:0 TABLET_COUNT: 35 START_SCN: 1718347182784953001 FINISH_SCN: 0 STATUS: DOING TRACE_ID: YB42AC1E87DC-00061AC2E77146D7-0-0 RESULT: 0 BALANCE_TASK_ID: 374414 TABLE_LOCK_OWNER_ID: 374434 COMMENT: 1 row in setFor more information about the fields in the
CDB_OB_TRANSFER_TASKSview, see CDB_OB_TRANSFER_TASKS.
View the partition balancing tasks in the background of a user tenant
Log in to the MySQL-compatible tenant or Oracle-compatible tenant of the cluster as the tenant administrator of the user tenant.
The following is a connection example. Adjust the connection details according to your actual environment when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@mysql_tenant#obdemo -p***** -AExecute the following statement to view the partition balancing tasks currently being executed in the background of the current tenant.
MySQL-compatible modeOracle-compatible modeView the partition balancing tasks being executed in the specified tenant.
The
DBA_OB_BALANCE_JOBSview displays the macro-level balancing tasks being executed in the current tenant, including scaling out, scaling in, migration balancing, and partition balancing tasks.obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_BALANCE_JOBS WHERE JOB_TYPE = 'PARTITION_BALANCE';The query result is as follows:
+--------+----------------------------+----------------------------+---------------------------------+-------------------+-----------------+-------------------------+--------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ | JOB_ID | CREATE_TIME | MODIFY_TIME | BALANCE_STRATEGY | JOB_TYPE | TARGET_UNIT_NUM | TARGET_PRIMARY_ZONE_NUM | STATUS | COMMENT | MAX_END_TIME | ZONE_UNIT_NUM_LIST | PARAMETER_LIST | +--------+----------------------------+----------------------------+---------------------------------+-------------------+-----------------+-------------------------+--------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ | 374412 | 2024-06-14 14:39:38.710194 | 2024-06-14 14:39:38.710194 | partition attribution alignment | PARTITION_BALANCE | NULL | 1 | DOING | NULL | NULL | zone1:1 | ls_scale_out_factor:1,enable_rebalance:true,enable_transfer:true,enable_gts_standalone:false | +--------+----------------------------+----------------------------+---------------------------------+-------------------+-----------------+-------------------------+--------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ 1 row in setFor more information about the fields in the
DBA_OB_BALANCE_JOBSview, see DBA_OB_BALANCE_JOBS.View the log stream-level partition balancing tasks being executed for the specified tenant.
The
DBA_OB_BALANCE_TASKSview displays the log stream-level tasks currently being executed for the current tenant, including log stream split (LS_SPLIT), log stream merge (LS_MERGE), log stream transfer (LS_TRANSFER), and log stream attribute modification (LS_ALTER).obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_BALANCE_TASKS WHERE BALANCE_STRATEGY LIKE '%partition%';The query result is as follows:
+---------+----------------------------+----------------------------+-------------+--------+---------+---------------------------------------------------------------------------------------------------+--------------------+------------+---------------------+-------------+----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ | TASK_ID | CREATE_TIME | MODIFY_TIME | TASK_TYPE | SRC_LS | DEST_LS | PART_LIST | FINISHED_PART_LIST | PART_COUNT | FINISHED_PART_COUNT | LS_GROUP_ID | STATUS | PARENT_LIST | CHILD_LIST | CURRENT_TRANSFER_TASK_ID | JOB_ID | COMMENT | BALANCE_STRATEGY | +---------+----------------------------+----------------------------+-------------+--------+---------+---------------------------------------------------------------------------------------------------+--------------------+------------+---------------------+-------------+----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ | 374414 | 2024-06-14 14:39:38.710194 | 2024-06-14 14:39:42.356430 | LS_TRANSFER | 1002 | 1001 | 500224:500224,500229:500229,500234:500234,500239:500239,500244:500244,500249:500249,500254:500254 | NULL | 7 | 0 | 1001 | TRANSFER | | 374415 | 3 | 374412 | | partition attribution alignment | | 374415 | 2024-06-14 14:39:38.710194 | 2024-06-14 14:39:38.710194 | LS_ALTER | 1002 | -1 | NULL | NULL | 0 | 0 | 0 | INIT | 374414 | NULL | -1 | 374412 | NULL | partition attribution alignment | +---------+----------------------------+----------------------------+-------------+--------+---------+---------------------------------------------------------------------------------------------------+--------------------+------------+---------------------+-------------+----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ 2 rows in setFor more information about the fields in the
DBA_OB_BALANCE_TASKSview, see DBA_OB_BALANCE_TASKS.View the tablet-level partition balancing tasks being executed for the specified tenant.
The
DBA_OB_TRANSFER_TASKSview displays the tablet-level tasks currently being executed for the current tenant, showing which partitions and Tablets of the tenant are being transferred.obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_TRANSFER_TASKS\GThe query result is as follows:
*************************** 1. row *************************** TASK_ID: 3 CREATE_TIME: 2024-06-14 14:39:42.356430 MODIFY_TIME: 2024-06-14 14:38:44.315350 SRC_LS: 1002 DEST_LS: 1001 PART_LIST: 500224:500224,500229:500229,500234:500234,500239:500239,500244:500244,500249:500249,500254:500254 PART_COUNT: 7 NOT_EXIST_PART_LIST: NULL LOCK_CONFLICT_PART_LIST: NULL TABLE_LOCK_TABLET_LIST: NULL TABLET_LIST: 200089:0,200090:0,200091:0,200092:0,200093:0,200094:0,200095:0,1152921504606847076:0,1152921504606847077:0,1152921504606847078:0,1152921504606847079:0,1152921504606847080:0,1152921504606847081:0,1152921504606847082:0,1152921504606847083:0,1152921504606847084:0,1152921504606847085:0,1152921504606847086:0,1152921504606847087:0,1152921504606847088:0,1152921504606847089:0,1152921504606847090:0,1152921504606847091:0,1152921504606847092:0,1152921504606847093:0,1152921504606847094:0,1152921504606847095:0,1152921504606847096:0,1152921504606847097:0,1152921504606847098:0,1152921504606847099:0,1152921504606847100:0,1152921504606847101:0,1152921504606847102:0,1152921504606847103:0 TABLET_COUNT: 35 START_SCN: 1718347182784953001 FINISH_SCN: 0 STATUS: DOING TRACE_ID: YB42AC1E87DC-00061AC2E77146D7-0-0 RESULT: 0 BALANCE_TASK_ID: 374414 TABLE_LOCK_OWNER_ID: 374434 COMMENT: 1 row in setFor more information about the fields in the
DBA_OB_TRANSFER_TASKSview, see DBA_OB_TRANSFER_TASKS.
View the partition balancing tasks being executed in the specified tenant.
The
DBA_OB_BALANCE_JOBSview displays the macro-level balancing tasks currently being executed by the current tenant, including scaling out, scaling in, migration balancing, and partition balancing tasks.obclient(SYS@oracle001)[SYS]> SELECT * FROM SYS.DBA_OB_BALANCE_JOBS WHERE JOB_TYPE = 'PARTITION_BALANCE';The query result is as follows:
+--------+------------------------------+------------------------------+---------------------------------+-------------------+-----------------+-------------------------+--------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ | JOB_ID | CREATE_TIME | MODIFY_TIME | BALANCE_STRATEGY | JOB_TYPE | TARGET_UNIT_NUM | TARGET_PRIMARY_ZONE_NUM | STATUS | COMMENT | MAX_END_TIME | ZONE_UNIT_NUM_LIST | PARAMETER_LIST | +--------+------------------------------+------------------------------+---------------------------------+-------------------+-----------------+-------------------------+--------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ | 370858 | 14-JUN-24 02.22.54.870414 PM | 14-JUN-24 02.22.54.870414 PM | partition attribution alignment | PARTITION_BALANCE | NULL | 1 | DOING | NULL | NULL | zone1:1 | ls_scale_out_factor:1,enable_rebalance:true,enable_transfer:true,enable_gts_standalone:false | +--------+------------------------------+------------------------------+---------------------------------+-------------------+-----------------+-------------------------+--------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ 1 row in setFor more information about the fields in the
DBA_OB_BALANCE_JOBSview, see DBA_OB_BALANCE_JOBS.View the partition balancing tasks at the log stream level that are being executed by the specified tenant.
The
DBA_OB_BALANCE_TASKSview displays the log stream level tasks that are being executed by the current tenant, including log stream split (LS_SPLIT), log stream merge (LS_MERGE), log stream transfer (LS_TRANSFER), and modifying log stream attributes (LS_ALTER) tasks.obclient(SYS@oracle001)[SYS]> SELECT * FROM SYS.DBA_OB_BALANCE_TASKS WHERE BALANCE_STRATEGY LIKE '%partition%';The query result is as follows:
+---------+------------------------------+------------------------------+-------------+--------+---------+-----------------------------------------------------------------------+--------------------+------------+---------------------+-------------+----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ | TASK_ID | CREATE_TIME | MODIFY_TIME | TASK_TYPE | SRC_LS | DEST_LS | PART_LIST | FINISHED_PART_LIST | PART_COUNT | FINISHED_PART_COUNT | LS_GROUP_ID | STATUS | PARENT_LIST | CHILD_LIST | CURRENT_TRANSFER_TASK_ID | JOB_ID | COMMENT | BALANCE_STRATEGY | +---------+------------------------------+------------------------------+-------------+--------+---------+-----------------------------------------------------------------------+--------------------+------------+---------------------+-------------+----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ | 370859 | 14-JUN-24 02.22.54.870414 PM | 14-JUN-24 02.22.55.737260 PM | LS_ALTER | 1002 | -1 | NULL | NULL | 0 | 0 | 1001 | ALTER_LS | NULL | 370860 | -1 | 370858 | NULL | partition attribution alignment | | 370860 | 14-JUN-24 02.22.54.870414 PM | 14-JUN-24 02.22.54.870414 PM | LS_TRANSFER | 1002 | 1001 | 500048:500048,500051:500051,500054:500054,500057:500057,500060:500060 | NULL | 5 | 0 | 1001 | INIT | 370859 | 370861 | -1 | 370858 | NULL | partition attribution alignment | | 370861 | 14-JUN-24 02.22.54.870414 PM | 14-JUN-24 02.22.54.870414 PM | LS_ALTER | 1002 | -1 | NULL | NULL | 0 | 0 | 0 | INIT | 370860 | NULL | -1 | 370858 | NULL | partition attribution alignment | +---------+------------------------------+------------------------------+-------------+--------+---------+-----------------------------------------------------------------------+--------------------+------------+---------------------+-------------+----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ 3 rows in setFor more information about the fields in the
DBA_OB_BALANCE_TASKSview, see DBA_OB_BALANCE_TASKS.View the tablet-level partition balance tasks being executed for a specified tenant.
The
DBA_OB_TRANSFER_TASKSview displays the tablet-level tasks being executed for the current tenant, specifically indicating which partitions and tablets of the tenant are being transferred.obclient(SYS@oracle001)[SYS]> SELECT * FROM SYS.DBA_OB_TRANSFER_TASKS\GThe query result is as follows:
*************************** 1. row *************************** TASK_ID: 2 CREATE_TIME: 14-JUN-24 02.22.58.755501 PM MODIFY_TIME: 14-JUN-24 02.22.59.267311 PM SRC_LS: 1002 DEST_LS: 1001 PART_LIST: 500048:500048,500051:500051,500054:500054,500057:500057,500060:500060 PART_COUNT: 5 NOT_EXIST_PART_LIST: NULL LOCK_CONFLICT_PART_LIST: NULL TABLE_LOCK_TABLET_LIST: NULL TABLET_LIST: 200015:0,200016:0,200017:0,200018:0,200019:0,1152921504606847003:0,1152921504606847004:0,1152921504606847005:0,1152921504606847006:0,1152921504606847007:0,1152921504606847008:0,1152921504606847009:0,1152921504606847010:0,1152921504606847011:0,1152921504606847012:0 TABLET_COUNT: 15 START_SCN: 1718346179101597002 FINISH_SCN: 0 STATUS: DOING TRACE_ID: YB42AC1E87DC-00061AC2EE11426E-0-0 RESULT: 0 BALANCE_TASK_ID: 370860 TABLE_LOCK_OWNER_ID: 370880 COMMENT: NULL 1 row in setFor more information about the fields in the
DBA_OB_TRANSFER_TASKSview, see DBA_OB_TRANSFER_TASKS.