After a partition balancing task is triggered, you can view the task execution in the view.
View the partition balancing tasks of the system tenant
Log in to the sys tenant of the cluster as the
rootuser.The following example shows how to connect to the database. Replace the placeholders with the actual values in your environment.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AExecute the following statement to view the partition balancing tasks of the specified tenant.
View the partition balancing tasks of the specified tenant.
The
CDB_OB_BALANCE_JOBSview displays all macro-level balancing tasks of all tenants, including expansion, reduction, migration, 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 partition balancing tasks of the specified tenant at the log stream level.
The
CDB_OB_BALANCE_TASKSview displays all log stream-level tasks of all tenants, including LS split (LS_SPLIT), LS merge (LS_MERGE), LS transfer (LS_TRANSFER), and LS 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 the partition balancing tasks of the specified tenant at the tablet level.
The
CDB_OB_TRANSFER_TASKSview displays all tablet-level tasks of all tenants, including the specific partitions and tablets of the tenant that are involved in the transfer operation.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 balance tasks in the background for a user tenant
Log in as the tenant administrator of the user tenant to the MySQL tenant or Oracle tenant of the cluster.
The following example shows how to connect to the database. Please replace the placeholders with the actual values in your environment.
obclient -h10.xx.xx.xx -P2883 -uroot@mysql_tenant#obdemo -p***** -AExecute the following statement to view the partition balance tasks in the background for the current tenant.
MySQL modeOracle modeView the partition balance tasks in the background for the specified tenant.
The
DBA_OB_BALANCE_JOBSview displays the macro-level balance tasks in the background for the current tenant, including tasks such as scale-out, scale-in, migration balance, and partition balance.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 partition balance tasks in the background for the specified tenant at the log stream level.
The
DBA_OB_BALANCE_TASKSview displays the log stream-level tasks in the background for the current tenant, including tasks such as 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 partition balance tasks in the background for the specified tenant at the tablet level.
The
DBA_OB_TRANSFER_TASKSview displays the tablet-level tasks in the background for the current tenant, including the specific partitions and tablets to be 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 balance tasks in the background for the specified tenant.
The
DBA_OB_BALANCE_JOBSview displays the macro-level balance tasks in the background for the current tenant, including tasks such as scale-out, scale-in, migration balance, and partition balance.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 balance tasks in the background for the specified tenant at the log stream level.
The
DBA_OB_BALANCE_TASKSview displays the log stream-level tasks in the background for the current tenant, including tasks such as log stream split (LS_SPLIT), log stream merge (LS_MERGE), log stream transfer (LS_TRANSFER), and log stream attribute modification (LS_ALTER).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 partition balance tasks in the background for the specified tenant at the tablet level.
The
DBA_OB_TRANSFER_TASKSview displays the tablet-level tasks in the background for the current tenant, including the specific partitions and tablets to be 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.
References
View the history of partition balance tasks in the background
