TDSQL Boundless META_CLUSTER_RGS

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

相关产品
TDSQL Boundless 产品页,含版本规格、价格与购买入口。

一、支持版本

适用于 TDSQL Boundless V18.0.0 及以上版本。

各版本变更如下:

·V18.0.0:首次引入 META_CLUSTER_RGS,提供复制组基础元信息查询。

·V21.2.0:新增 property、witness_quorum、witnesses 字段,支持日志副本和广播同步 RG 属性展示。

·V21.6.3.0:新增 rep_group_stats_cache_db_approximate_size、rep_group_stats_durable_db_approximate_size、storage_tier、temperature_state,用于展示副本组的统计缓存大小、持久化统计大小、所处存储层级以及冷热温度状态。

二、字段说明

字段名 类型 描述
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 成员。
rep_group_stats_cache_db_approximate_size bigint unsigned 副本组在 cacheDB(缓存层)中的近似数据量大小,单位为 bytes。仅冷数据副本组有值,热数据副本组为0。
rep_group_stats_durable_db_approximate_size bigint unsigned 副本组在 durableDB(持久层)中的近似数据量大小,单位为 bytes。仅冷数据副本组有值,热数据副本组为0。
storage_tier varchar(64) 副本组所属的存储层级。STORAGE_TIER_OPT_AUTO:自动选择存储层级。STORAGE_TIER_OPT_LOCAL_STORAGE:本地存储。STORAGE_TIER_OPT_OBJECT_STORAGE:对象存储。
temperature_state varchar(64) 副本组的冷热温度状态。RG_NORMAL:正常状态(热数据)。RG_TIERED_COLD:已转冷状态。RG_TIERED_PRE_COLD:正在转冷中。RG_TIERED_PRE_NORMAL:正在回暖中。

三、示例

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: 6783rep_group_log_info_raft_log_sync_delay_seconds: 11 property: RG_PROPERTY_DEFAULT witness_quorum: 0 witnesses: [] rep_group_stats_cache_db_approximate_size: 0 rep_group_stats_durable_db_approximate_size: 0 storage_tier: STORAGE_TIER_OPT_LOCAL_STORAGE temperature_state: RG_NORMAL*************************** 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: 864rep_group_log_info_raft_log_sync_delay_seconds: 18446744073709551615 property: RG_PROPERTY_DEFAULT witness_quorum: 0 witnesses: [] rep_group_stats_cache_db_approximate_size: 1024 rep_group_stats_durable_db_approximate_size: 2048 storage_tier: STORAGE_TIER_OPT_OBJECT_STORAGE temperature_state: RG_TIERED_COLD2 rows in set (0.01 sec)

赞 (0)
上一篇 4天前
下一篇 4天前