功能
TDSTORE_LARGE_TXN 用于查询 TDStore 层大事务的运行状态和资源使用情况。字段说明
字段名 | 类型 | 描述 |
replication_group_id | bigint unsigned | 大事务所属的 Replication Group 的 ID。 |
transaction_id | bigint unsigned | 大事务的 Transaction ID。 |
prepare_ts | bigint unsigned | 大事务的 prepare 时间戳。 |
commit_ts | bigint unsigned | 大事务的 commit 时间戳。 |
raft_log_index | bigint | 大事务提交或回滚时的 Raft Log Index。 |
main_cf_id | int | 大事务对应的主 Column Family ID。 |
compacted | int | 大事务的数据是否已被 compaction。 |
rollback | int | 大事务是否已回滚。 |
destroyed | int | 大事务是否已被销毁。 |
split_merge_rep_group_ids | varchar(513) | 分裂/合并来源的 Replication Group ID 列表。 |
split_merge_raft_log_indexes | varchar(513) | 分裂/合并来源的 Raft Log Index 列表。 |
persisted_raft_log_index | bigint | 大事务已持久化的 Raft Log Index。-1表示所有日志均已持久化。 |
disk_usage_bytes | bigint unsigned | 大事务占用的磁盘空间,单位字节。 |
memory_usage_bytes | bigint unsigned | 大事务占用的内存空间,单位字节。 |
示例
事务进行中(尚未提交),可观察到大事务记录:
tdsql> SELECT * FROM information_schema.TDSTORE_LARGE_TXN\\G*************************** 1. row ***************************replication_group_id: 769transaction_id: 29749682641045458prepare_ts: NULLcommit_ts: NULLraft_log_index: NULLmain_cf_id: 2compacted: 0rollback: 0destroyed: 0split_merge_rep_group_ids: []split_merge_raft_log_indexes: []persisted_raft_log_index: 0disk_usage_bytes: 0memory_usage_bytes: 6021041 row in set (0.00 sec)
事务提交后:
tdsql> SELECT * FROM information_schema.TDSTORE_LARGE_TXN\\G*************************** 1. row ***************************replication_group_id: 769transaction_id: 29749682641045458prepare_ts: 29749682641045458commit_ts: 29749682641045504raft_log_index: 84main_cf_id: 2compacted: 1rollback: 0destroyed: 0split_merge_rep_group_ids: []split_merge_raft_log_indexes: []persisted_raft_log_index: -1disk_usage_bytes: 3577memory_usage_bytes: 20481 row in set (0.00 sec)