功能
INFORMATION_SCHEMA.META_CLUSTER_REPLICAS用于展示实例内 RG 的所有副本相关的元信息。字段说明
字段名 | 类型 | 描述 |
rep_group_id | bigint unsigned | RG ID。 |
member_role | varchar(64) | 副本角色,支持 MEMBER_ROLE_FOLLOWER、MEMBER_ROLE_LEADER、MEMBER_ROLE_LEARNER。 |
rep_group_state | varchar(64) | RG 状态。 |
meta_version | bigint | 元信息版本号。 |
member_version | bigint | 成员变更版本号。 |
key_range_version | bigint | Key 区间版本号。 |
quorum | int unsigned | 法定 Quorum。 |
node_name | varchar(320) | 所在的节点名。 |
tdstore_ip_port | varchar(64) | 所在 TDStore 节点地址。 |
last_report_time | varchar(64) | 最后心跳上报的时间。 |
last_working_time | varchar(64) | 副本为工作状态( WORKING、SPLIT、MERGE)的最后时间。 |
rep_group_stats_approximate_size | bigint unsigned | 副本的近似数据量大小,单位为 bytes。 |
rep_group_stats_approximate_keys | bigint unsigned | 副本中 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 | 副本日志同步延迟。 |
示例
tdsql>select * from information_schema.META_CLUSTER_REPLICAS limit 1 \\G*************************** 1. row ***************************rep_group_id: 1792member_role: MEMBER_ROLE_FOLLOWERrep_group_state: RG_STATE_F_WORKINGmeta_version: 36member_version: 0key_range_version: 36quorum: 3node_name: node-tdsql3-86ea1ffe-001tdstore_ip_port: 10.0.36.9:6005last_report_time: 2024-08-19 17:30:01.444681last_working_time: 2024-08-19 17:30:01.444681rep_group_stats_approximate_size: 9720817rep_group_stats_approximate_keys: 3825rep_group_log_info_current_term: 9rep_group_log_info_committed_index: 8011rep_group_log_info_consecutive_applied_index: 8011rep_group_log_info_last_snapshot_index: 7997rep_group_log_info_first_index: 2rep_group_log_info_last_index: 8011rep_group_log_info_disk_index: 8011rep_group_log_info_applied_index: 8011rep_group_log_info_raft_log_sync_delay_seconds: 01 row in set (0.01 sec)