Note
For V4.4.2, this view is available starting from V4.4.2 BP2.
Overview
The GV$OB_LS_LOG_REPLAY_STAT view displays the log replay progress for each log stream replica on all nodes of a tenant. You must query this view on a standby database, or on the primary database by querying a follower replica.
Since logs are not replayed on the leader replica of the primary tenant (primary database), in query results, a row with ROLE = LEADER for the primary tenant is meaningless.
Columns
Column |
Type |
Nullable |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID |
| SVR_IP | varchar(46) | NO | Server IP address |
| SVR_PORT | bigint(20) | NO | Server port number |
| LS_ID | bigint(20) | NO | Log stream ID |
| ROLE | varchar(32) | NO | Log stream replica roles:
|
| ENABLED | tinyint(4) | NO | Whether the log replay service is enabled. |
| END_LSN | bigint(20) unsigned | NO | LSN written by Palf (right boundary for log replay) |
| UNSUBMITTED_LSN | bigint(20) unsigned | NO | The LSN of the next log to be committed to the replay queue |
| UNSUBMITTED_SCN | bigint(20) unsigned | NO | SCN of the next log to be submitted to the replay queue |
| MIN_UNREPLAYED_LSN | bigint(20) unsigned | NO | LSN of the earliest unreplayed log in the replay queue |
| MIN_UNREPLAYED_SCN | bigint(20) unsigned | NO | SCN of the earliest unreplayed log in the replay queue |
| PENDING_CNT | bigint(20) | NO | Number of tasks pending replay in memory |
Sample query
In the sys tenant of the cluster where the standby tenant resides, view the log replay progress for each log stream on all nodes of the standby tenant with tenant ID 1002.
obclient(root@sys)[oceanbase]> SELECT TENANT_ID, SVR_IP, SVR_PORT, LS_ID, ROLE, ENABLED,
END_LSN, UNSUBMITTED_LSN, MIN_UNREPLAYED_LSN, PENDING_CNT
FROM oceanbase.GV$OB_LS_LOG_REPLAY_STAT WHERE TENANT_ID = 1002;
The query result is as follows:
+-----------+--------------+----------+-------+----------+---------+-----------+-----------------+--------------------+-------------+
| TENANT_ID | SVR_IP | SVR_PORT | LS_ID | ROLE | ENABLED | END_LSN | UNSUBMITTED_LSN | MIN_UNREPLAYED_LSN | PENDING_CNT |
+-----------+--------------+----------+-------+----------+---------+-----------+-----------------+--------------------+-------------+
| 1002 | 6.xx.xxx.160 | 2882 | 1 | FOLLOWER | 1 | 300636581 | 300060582 | 300060582 | 0 |
| 1002 | 6.xx.xxx.160 | 2882 | 1001 | FOLLOWER | 1 | 197547054 | 197052262 | 197052262 | 0 |
+-----------+--------------+----------+-------+----------+---------+-----------+-----------------+--------------------+-------------+
2 rows in set
