META_CLUSTER_RGS

最近更新时间:2025-11-18 10:10:23

我的收藏

功能

INFORMATION_SCHEMA.META_CLUSTER_RGS用于存储和展示实例中复制组(Replication Group,RG)相关的元信息。

字段说明

字段名
类型
描述
rep_group_id
bigint unsigned
RG ID。
data_space_type
varchar(64)
数据空间类型。
DATA_SPACE_TYPE_SYSTEM:系统空间。
DATA_SPACE_TYPE_USER:用户空间。
rep_group_state
varchar(64)
RG 状态。
meta_version
bigint
元信息版本号。
member_version
bigint
成员变更版本号。
key_range_version
bigint
key 区间版本号。
quorum
int unsigned
法定 Quorum。
member_node_names
varchar(320)
成员列表。
leader_node_name
varchar(320)
Leader 成员。
last_leader_report_time
varchar(64)
最后心跳上报的时间。
create_time
varchar(64)
RG 的创建时间。
parent_rep_group_id
bigint unsigned
如果发生分裂则体现父 RG ID,否则值为 0
rep_group_stats_approximate_size
bigint unsigned
RG Leader 的近似数据量大小,单位为 bytes。
rep_group_stats_approximate_keys
bigint unsigned
RG Leader 中 key 的近似数量。
rep_group_log_info_current_term
bigint unsigned
当前 Leader 任期。
rep_group_log_info_committed_index
bigint unsigned
已提交的日志号。
rep_group_log_info_consecutive_applied_index
bigint unsigned
已应用的日志号。
rep_group_log_info_last_snapshot_index
bigint unsigned
最后一次做快照的位点日志号。
rep_group_log_info_first_index
bigint unsigned
内存中保留的 Raft Log 首位日志号,表示之前的日志都被 Purge 了。
rep_group_log_info_last_index
bigint unsigned
内存中保留的 Raft Log 末位日志号。
rep_group_log_info_disk_index
bigint unsigned
已落盘的 Raft Log 日志号。
rep_group_log_info_applied_index
bigint unsigned
已应用的 Raft Log 日志号。
rep_group_log_info_raft_log_sync_delay_seconds
bigint unsigned
副本日志同步延迟。

property
varchar(64)
RG属性:
RG_PROPERTY_DEFAULT:普通 RG。
RG_PROPERTY_BROADCAST:广播 RG。
RG_PROPERTY_SYNC:同步 RG。
RG_PROPERTY_BROADCAST_SYNC:广播同步 RG。
witness_quorum
int unsigned
witness 法定 Quorum。
witnesses
longtext
witness 成员。

示例

tdsql>SELECT * FROM information_schema.meta_cluster_rgs\\G;
*************************** 1. row ***************************
rep_group_id: 1792
data_space_type: DATA_SPACE_TYPE_SYSTEM
rep_group_state: RG_STATE_L_WORKING
meta_version: 36
member_version: 0
key_range_version: 36
quorum: 3
member_node_names: [node-tdsql3-86ea1ffe-001, node-tdsql3-86ea1ffe-002, node-tdsql3-86ea1ffe-003]
leader_node_name: node-tdsql3-86ea1ffe-002
last_leader_report_time: 2024-08-19 16:31:47.866168
create_time: 2024-08-19 14:56:47.692831
parent_rep_group_id: 0
rep_group_stats_approximate_size: 9725997
rep_group_stats_approximate_keys: 3836
rep_group_log_info_current_term: 9
rep_group_log_info_committed_index: 6783
rep_group_log_info_consecutive_applied_index: 6783
rep_group_log_info_last_snapshot_index: 6727
rep_group_log_info_first_index: 2
rep_group_log_info_last_index: 6783
rep_group_log_info_disk_index: 6783
rep_group_log_info_applied_index: 6783
rep_group_log_info_raft_log_sync_delay_seconds: 11
property: RG_PROPERTY_DEFAULT
witness_quorum: 0
witnesses: []
*************************** 2. row ***************************
rep_group_id: 1281
data_space_type: DATA_SPACE_TYPE_USER
rep_group_state: RG_STATE_L_WORKING
meta_version: 3
member_version: 0
key_range_version: 3
quorum: 3
member_node_names: [node-tdsql3-86ea1ffe-001, node-tdsql3-86ea1ffe-002, node-tdsql3-86ea1ffe-003]
leader_node_name: node-tdsql3-86ea1ffe-003
last_leader_report_time: 2024-08-19 16:31:49.145344
create_time: 2024-08-19 14:56:47.817777
parent_rep_group_id: 0
rep_group_stats_approximate_size: 3070
rep_group_stats_approximate_keys: 27
rep_group_log_info_current_term: 3
rep_group_log_info_committed_index: 864
rep_group_log_info_consecutive_applied_index: 864
rep_group_log_info_last_snapshot_index: 831
rep_group_log_info_first_index: 2
rep_group_log_info_last_index: 864
rep_group_log_info_disk_index: 864
rep_group_log_info_applied_index: 864
rep_group_log_info_raft_log_sync_delay_seconds: 18446744073709551615
property: RG_PROPERTY_DEFAULT
witness_quorum: 0
witnesses: []

2 rows in set (0.01 sec)