Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The oceanbase.CDB_OB_LS_LOCATIONS view displays the distribution of the log stream (LS) replicas of all tenants.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| CREATE_TIME | datetime(6) | NO | The time when the log stream was created. |
| MODIFY_TIME | datetime(6) | NO | The time when the log stream was modified. |
| 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. |
| SQL_PORT | bigint(20) | NO | The SQL port number. |
| ZONE | varchar(128) | NO | The name of the zone. |
| ROLE | varchar(8) | NO | The role of the replica. Valid values: LEADERFOLLOWER |
| MEMBER_LIST | varchar(4480) | NO | The list of replica members. This column has a valid value when ROLE is set to LEADER, and is NULL if otherwise. |
| PAXOS_REPLICA_NUMBER | bigint(20) | NO | The quorum of a Paxos group. This column has a valid value when ROLE is set to LEADER, and is NULL if otherwise. |
| REPLICA_TYPE | varchar(18) | NO | The type of the replica. FULL: indicates a full-featured replica.LOGONLY: indicates a log replica.READONLY: indicates a read-only replica.ENCRYPTION_LOGONLY: indicates an encrypted log replica.NULL: indicates an unknown replica type. |
| LEARNER_LIST | longtext | YES | A list of read-only replicas for the current log stream.
NoteThis column is introduced since OceanBase Database V4.2.0. |
| REBUILD | varchar(5) | NO | Indicates whether the replica is being rebuilt.
NoteThis column is introduced since OceanBase Database V4.2.1. |
Sample query
The following example shows how to view the distribution information of log stream replicas for all tenants.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_LS_LOCATIONS;
The query result is as follows:
+----------------------------+----------------------------+-----------+-------+----------------+----------+----------+-------+--------+-----------------------+----------------------+--------------+--------------+---------+
| CREATE_TIME | MODIFY_TIME | TENANT_ID | LS_ID | SVR_IP | SVR_PORT | SQL_PORT | ZONE | ROLE | MEMBER_LIST | PAXOS_REPLICA_NUMBER | REPLICA_TYPE | LEARNER_LIST | REBUILD |
+----------------------------+----------------------------+-----------+-------+----------------+----------+----------+-------+--------+-----------------------+----------------------+--------------+--------------+---------+
| 2024-09-04 09:49:41.360880 | 2024-09-04 09:49:41.360880 | 1 | 1 | 172.xx.xxx.xxx | 2882 | 2881 | zone1 | LEADER | 172.xx.xxx.xxx:2882:1 | 1 | FULL | | FALSE |
| 2024-09-03 11:24:40.666453 | 2024-09-03 11:24:44.012831 | 1001 | 1 | 172.xx.xxx.xxx | 2882 | 2881 | zone1 | LEADER | 172.xx.xxx.xxx:2882:1 | 1 | FULL | | FALSE |
| 2024-09-03 11:24:50.890232 | 2024-09-03 11:24:53.272771 | 1002 | 1 | 172.xx.xxx.xxx | 2882 | 2881 | zone1 | LEADER | 172.xx.xxx.xxx:2882:1 | 1 | FULL | | FALSE |
| 2024-09-03 11:25:04.074197 | 2024-09-03 11:25:06.474247 | 1002 | 1001 | 172.xx.xxx.xxx | 2882 | 2881 | zone1 | LEADER | 172.xx.xxx.xxx:2882:1 | 1 | FULL | | FALSE |
| 2024-09-03 11:25:20.454418 | 2024-09-03 11:25:22.781502 | 1003 | 1 | 172.xx.xxx.xxx | 2882 | 2881 | zone1 | LEADER | 172.xx.xxx.xxx:2882:1 | 1 | FULL | | FALSE |
| 2024-09-03 11:25:29.853284 | 2024-09-03 11:25:32.239761 | 1004 | 1 | 172.xx.xxx.xxx | 2882 | 2881 | zone1 | LEADER | 172.xx.xxx.xxx:2882:1 | 1 | FULL | | FALSE |
| 2024-09-03 11:25:42.831141 | 2024-09-03 11:25:45.241945 | 1004 | 1001 | 172.xx.xxx.xxx | 2882 | 2881 | zone1 | LEADER | 172.xx.xxx.xxx:2882:1 | 1 | FULL | | FALSE |
+----------------------------+----------------------------+-----------+-------+----------------+----------+----------+-------+--------+-----------------------+----------------------+--------------+--------------+---------+
7 rows in set