After a partition balancing task is triggered, you can view the execution status of the task by querying a view.
View background partition balancing tasks in the sys tenant
Log in to the sys tenant of the cluster as the
rootuser.Note that you must specify the corresponding options in the following sample code based on your actual database configurations.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AExecute the following statements to view the partition balancing tasks currently running in the background for a specified tenant.
View partition balancing tasks being executed by a specified tenant.
The
CDB_OB_BALANCE_JOBSview displays macro-level balancing tasks currently in progress for all tenants, including expansion, contraction, 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 log stream (LS)-level partition balancing tasks being executed by a specified tenant.
The
CDB_OB_BALANCE_TASKSview displays log stream-level tasks currently in progress 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) tasks.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 tablet-level partition balancing tasks being executed by a specified tenant.
The
CDB_OB_TRANSFER_TASKSview displays tablet-level tasks currently in progress for all tenants, showing which specific partitions and tablets within the tenant are undergoing transfer operations.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 columns in the
CDB_OB_TRANSFER_TASKSview, see CDB_OB_TRANSFER_TASKS.
View partition balancing tasks in the background of a user tenant
Log in to the cluster as the tenant administrator of the user tenant.
Note that you must specify the corresponding options in the following sample code based on your actual database configurations.
obclient -h10.xx.xx.xx -P2883 -uroot@mysql_tenant#obdemo -p***** -AExecute the following statements to view the partition balancing tasks currently running in the background of the tenant.
View the partition balancing tasks being executed for the current tenant.
The
DBA_OB_BALANCE_JOBSview displays macro-level balancing tasks currently being executed for the current tenant, including expansion, contraction, 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 columns in the
DBA_OB_BALANCE_JOBSview, see DBA_OB_BALANCE_JOBS.View the log stream (LS)-level partition balancing tasks being executed for the current tenant.
The
DBA_OB_BALANCE_TASKSview displays 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) tasks.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 columns in the
DBA_OB_BALANCE_TASKSview, see DBA_OB_BALANCE_TASKS.View the tablet-level partition balancing tasks being executed for the current tenant.
The
DBA_OB_TRANSFER_TASKSview displays tablet-level tasks currently being executed for the current tenant, showing which specific partitions and tablets within the tenant are undergoing transfer operations.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 columns in the
DBA_OB_TRANSFER_TASKSview, see DBA_OB_TRANSFER_TASKS.