Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The V$OB_LOG_STAT view displays the Palf status of log streams. You can use this view to perform the following operations:
- Query whether a log stream has a leader.
- Query the member list (number of Paxos replicas) of a log stream.
- Query the replica synchronization status.
- Query the recyclable checkpoint of the logs of a log stream.
- Query the log consumption service scope of a log stream based on the log sequence number (LSN) or system change number (SCN).
- Query the access mode of Palf.
The query results vary based on the tenant.
- When you query this view from the
systenant, the Palf status of all tenant log streams is displayed. - When you query this view from a user tenant, only the Palf status of the log streams of the current tenant is displayed.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| LS_ID | bigint(20) | NO | The ID of the log stream. |
| SVR_IP | varchar(46) | NO | The IP address of the OBServer node. |
| SVR_PORT | bigint(20) | NO | The port number of the OBServer node. |
| ROLE | varchar(32) | NO | The role of the replica. Valid values:
|
| PROPOSAL_ID | bigint(20) | NO | The proposal ID of Paxos. |
| CONFIG_VERSION | varchar(128) | NO | The version number corresponding to the configuration change. |
| ACCESS_MODE | varchar(32) | NO | The access mode. Valid values:
|
| SYNC_MODE | varchar(128) | NO | The synchronization mode of the log stream replica:
NoteThis column is available starting with V4.4.2 BP1. |
| PAXOS_MEMBER_LIST | varchar(1024) | NO | The list of Paxos members. |
| PAXOS_REPLICA_NUM | bigint(20) | NO | The number of Paxos replicas. |
| IN_SYNC | varchar(3) | NO | Indicates whether the replica is completely synchronized with the leader. |
| BASE_LSN | bigint(20) | NO | The maximum recyclable checkpoint. |
| BEGIN_LSN | bigint(20) | NO | The LSN of the minimum consumption checkpoint. |
| BEGIN_SCN | bigint(20) | NO | The SCN of the minimum consumption checkpoint. |
| END_LSN | bigint(20) | NO | The LSN of the maximum consecutive majority checkpoint, also known as the maximum consumption checkpoint. |
| END_SCN | bigint(20) | NO | The SCN of the maximum consecutive majority checkpoint, also known as the maximum consumption checkpoint. |
| MAX_LSN | bigint(20) | NO | The LSN of the maximum write point. |
| MAX_SCN | bigint(20) | NO | The SCN of the maximum write point. |
| ARBITRATION_MEMBER | varchar(128) | NO | The server address of the arbitration member.
NoteThis column is introduced since OceanBase Database V4.1.0. |
| DEGRADED_LIST | varchar(1024) | NO | The list of degraded full-featured replicas with arbitration enabled.
NoteThis column is introduced since OceanBase Database V4.1.0. |
| LEARNER_LIST | longtext | NO | The list of read-only replicas in the current log stream.
NoteThis column is introduced since OceanBase Database V4.2.0. |
Sample query
Query the log stream replicas of all tenants from the sys tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_LOG_STAT\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1
LS_ID: 1
SVR_IP: 6.xx.xxx.xx
SVR_PORT: 2882
ROLE: LEADER
PROPOSAL_ID: 1
CONFIG_VERSION: {proposal_id:1, config_seq:2}
ACCESS_MODE: APPEND
SYNC_MODE: ASYNC
PAXOS_MEMBER_LIST: 6.xx.xxx.xx:2882:1
PAXOS_REPLICA_NUM: 1
IN_SYNC: YES
BASE_LSN: 671047680
BEGIN_LSN: 0
BEGIN_SCN: 2
END_LSN: 957310218
END_SCN: 1776324806026296000
MAX_LSN: 957310218
MAX_SCN: 1776324806026296000
ARBITRATION_MEMBER:
DEGRADED_LIST:
LEARNER_LIST:
*************************** 2. row ***************************
TENANT_ID: 1001
LS_ID: 1
SVR_IP: 6.xx.xxx.xx
SVR_PORT: 2882
ROLE: LEADER
PROPOSAL_ID: 1
CONFIG_VERSION: {proposal_id:1, config_seq:2}
ACCESS_MODE: APPEND
SYNC_MODE: ASYNC
PAXOS_MEMBER_LIST: 6.xx.xxx.xx:2882:1
PAXOS_REPLICA_NUM: 1
IN_SYNC: YES
BASE_LSN: 1140781056
BEGIN_LSN: 268419072
BEGIN_SCN: 1776178094647758001
END_LSN: 1686422473
END_SCN: 1776324806075842000
MAX_LSN: 1686422473
MAX_SCN: 1776324806075842000
ARBITRATION_MEMBER:
DEGRADED_LIST:
LEARNER_LIST:
*************************** 3. row ***************************
TENANT_ID: 1002
LS_ID: 1
SVR_IP: 6.xx.xxx.xx
SVR_PORT: 2882
ROLE: LEADER
PROPOSAL_ID: 2
CONFIG_VERSION: {proposal_id:1, config_seq:2}
ACCESS_MODE: APPEND
SYNC_MODE: SYNC
PAXOS_MEMBER_LIST: 6.xx.xxx.xx:2882:1
PAXOS_REPLICA_NUM: 1
IN_SYNC: YES
BASE_LSN: 201314304
BEGIN_LSN: 0
BEGIN_SCN: 2
END_LSN: 288650567
END_SCN: 1776324806019931000
MAX_LSN: 288650567
MAX_SCN: 1776324806019931000
ARBITRATION_MEMBER:
DEGRADED_LIST:
LEARNER_LIST:
*************************** 4. row ***************************
TENANT_ID: 1002
LS_ID: 1001
SVR_IP: 6.xx.xxx.xx
SVR_PORT: 2882
ROLE: LEADER
PROPOSAL_ID: 4
CONFIG_VERSION: {proposal_id:1, config_seq:2}
ACCESS_MODE: APPEND
SYNC_MODE: SYNC
PAXOS_MEMBER_LIST: 6.xx.xxx.xx:2882:1
PAXOS_REPLICA_NUM: 1
IN_SYNC: YES
BASE_LSN: 134209536
BEGIN_LSN: 0
BEGIN_SCN: 1776152346193418001
END_LSN: 191930756
END_SCN: 1776324806019931000
MAX_LSN: 191930756
MAX_SCN: 1776324806019931000
ARBITRATION_MEMBER:
DEGRADED_LIST:
LEARNER_LIST:
*************************** 5. row ***************************
TENANT_ID: 1003
LS_ID: 1
SVR_IP: 6.xx.xxx.xx
SVR_PORT: 2882
ROLE: LEADER
PROPOSAL_ID: 1
CONFIG_VERSION: {proposal_id:1, config_seq:2}
ACCESS_MODE: APPEND
SYNC_MODE: ASYNC
PAXOS_MEMBER_LIST: 6.xx.xxx.xx:2882:1
PAXOS_REPLICA_NUM: 1
IN_SYNC: YES
BASE_LSN: 1140781056
BEGIN_LSN: 134209536
BEGIN_SCN: 1776164387287245001
END_LSN: 1595615821
END_SCN: 1776324806107505000
MAX_LSN: 1595615821
MAX_SCN: 1776324806107505000
ARBITRATION_MEMBER:
DEGRADED_LIST:
LEARNER_LIST:
*************************** 6. row ***************************
TENANT_ID: 1004
LS_ID: 1
SVR_IP: 6.xx.xxx.xx
SVR_PORT: 2882
ROLE: LEADER
PROPOSAL_ID: 1
CONFIG_VERSION: {proposal_id:1, config_seq:2}
ACCESS_MODE: APPEND
SYNC_MODE: ASYNC
PAXOS_MEMBER_LIST: 6.xx.xxx.xx:2882:1
PAXOS_REPLICA_NUM: 1
IN_SYNC: YES
BASE_LSN: 201314304
BEGIN_LSN: 0
BEGIN_SCN: 2
END_LSN: 269161449
END_SCN: 1776324806020994000
MAX_LSN: 269161449
MAX_SCN: 1776324806020994000
ARBITRATION_MEMBER:
DEGRADED_LIST:
LEARNER_LIST:
*************************** 7. row ***************************
TENANT_ID: 1004
LS_ID: 1001
SVR_IP: 6.xx.xxx.xx
SVR_PORT: 2882
ROLE: LEADER
PROPOSAL_ID: 3
CONFIG_VERSION: {proposal_id:1, config_seq:2}
ACCESS_MODE: APPEND
SYNC_MODE: ASYNC
PAXOS_MEMBER_LIST: 6.xx.xxx.xx:2882:1
PAXOS_REPLICA_NUM: 1
IN_SYNC: YES
BASE_LSN: 134209536
BEGIN_LSN: 0
BEGIN_SCN: 1776152356382893002
END_LSN: 191872346
END_SCN: 1776324806020994000
MAX_LSN: 191872346
MAX_SCN: 1776324806020994000
ARBITRATION_MEMBER:
DEGRADED_LIST:
LEARNER_LIST:
7 rows in set
