getSlaveReplicationStatus
Syntax
getSlaveReplicationStatus([limit=-1])
Arguments
limit is an integer that specifies the maximum tasks that can be returned in the result. The default value is -1, meaning no limit is placed.
Details
This function displays the cluster replication task status in the slave cluster. It returns a table where finished tasks are listed first, then followed by unfinished tasks.
If limit is not specified, there is no limit on the number of tasks returned.
If limit is specified, up to limit records (including finished and unfinished tasks) can be returned.
A maximum of 10,000 records of finished tasks are returned, and the unfinished tasks are displayed from the earliest time until the specified number of records is met.
It can only be executed by an administrator on the controller of a slave cluster.
It returns a table containing the following columns:
taskId: ID of asynchronous replication task.
masterTid: transaction ID in the master cluster.
groupId: ID of the group to which the asynchronous replication task belongs to.
operationType: operation type of the replication task.
createTime: the time (of NANOTIMESTAMP type) when the slave cluster receives the task from the master cluster.
dbName: the database name where the task is executed.
tableName: the table name where the task is executed.
srcIP: IP of the data node where data of write tasks is stored.
srcPort: port of the data node where data of write tasks is stored.
finishTime: the time (of NANOTIMESTAMP type) when the task is finished.
executionNode: the data node where the task is executed.
state: the task state, including WAITING, EXECUTING, FINISHED, and FAILED.
details: If state = FAILED, returns the failure cause; If state = FINISHED, provides additional description on the task.
Examples
$ getSlaveReplicationStatus();
taskId | masterTid | groupId | operationType | createTime | dbName | tableName | srcIP | srcPort | finishTime | executionNode | state | details |
---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | 1 | CREATE_DOMAIN | 2022.11.08T10:50:37.425056956 | db://test_dropPartition_value | localhost | 8002 | 2022.11.08T10:50:37.452792885 | NODE2 | FINISHED | ||
2 | 2 | 2 | CREATE_PARTITIONED_TABLE | 2022.11.08T10:50:37.425056988 | db://test_dropPartition_value | pt | localhost | 8002 | 2022.11.08T10:50:37.479906033 | NODE3 | FINISHED | |
3 | 3 | 3 | APPEND | 2022.11.08T10:50:37.425057012 | db://test_dropPartition_value | pt | localhost | 8002 | 2022.11.08T10:50:37.638746819 | NODE1 | FINISHED | |
4 | 4 | 4 | DROP_PARTITION | 2022.11.08T10:50:37.425057037 | pt | localhost | 8002 | 2022.11.08T10:50:37.869783336 | NODE2 | FINISHED |
Related functions: getMasterReplicationStatus, getClusterReplicationMetrics