Note
For V4.4.2, this view is available starting with 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 a follower replica of the primary database.
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 a standby tenant, view the log replay progress of each log stream replica on all nodes of the current tenant.
obclient(root@standby_tenant)[oceanbase]> SELECT 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;
The query result is as follows:
+--------------+----------+-------+----------+---------+-----------+-----------------+--------------------+-------------+
| SVR_IP | SVR_PORT | LS_ID | ROLE | ENABLED | END_LSN | UNSUBMITTED_LSN | MIN_UNREPLAYED_LSN | PENDING_CNT |
+--------------+----------+-------+----------+---------+-----------+-----------------+--------------------+-------------+
| 6.xx.xxx.160 | 2882 | 1 | FOLLOWER | 1 | 300636581 | 300227763 | 300227763 | 0 |
| 6.xx.xxx.160 | 2882 | 1001 | FOLLOWER | 1 | 197547054 | 197197913 | 197197913 | 0 |
+--------------+----------+-------+----------+---------+-----------+-----------------+--------------------+-------------+
2 rows in set
