From 6f68436ef1e9fac83f504fe0d035ee8f15e60541 Mon Sep 17 00:00:00 2001 From: Dennis Zhuang Date: Mon, 29 Apr 2024 21:25:08 +0800 Subject: [PATCH] feat: rename greptime_region_peers to region_peers --- .../src/information_schema/cluster_info.rs | 2 +- .../src/information_schema/table_names.rs | 2 +- tests-integration/tests/region_migration.rs | 14 ++++--- .../information_schema/cluster_info.result | 41 +++++++++++-------- .../information_schema/cluster_info.sql | 25 ++++++----- .../cases/standalone/common/partition.result | 5 +-- tests/cases/standalone/common/partition.sql | 6 +-- .../common/show/show_databases_tables.result | 3 +- .../common/system/information_schema.result | 18 ++++---- .../common/system/information_schema.sql | 2 +- .../information_schema/cluster_info.result | 15 ++++--- .../information_schema/cluster_info.sql | 9 ++-- 12 files changed, 82 insertions(+), 60 deletions(-) diff --git a/src/catalog/src/information_schema/cluster_info.rs b/src/catalog/src/information_schema/cluster_info.rs index 44b293278a91..d69aa56bb66d 100644 --- a/src/catalog/src/information_schema/cluster_info.rs +++ b/src/catalog/src/information_schema/cluster_info.rs @@ -57,7 +57,7 @@ const INIT_CAPACITY: usize = 42; /// The `CLUSTER_INFO` table provides information about the current topology of the cluster. /// /// - `peer_id`: the peer server id. -/// - `peer_type`: the peer type, such as `datanode`, `frontend`, `metasrv` etc. +/// - `peer_type`: the peer type, such as `DATANODE`, `FRONTEND`, `METASRV` etc. /// - `peer_addr`: the peer gRPC address. /// - `version`: the build package version of the peer. /// - `git_commit`: the build git commit hash of the peer. diff --git a/src/catalog/src/information_schema/table_names.rs b/src/catalog/src/information_schema/table_names.rs index cdc695646a9d..eb856e031834 100644 --- a/src/catalog/src/information_schema/table_names.rs +++ b/src/catalog/src/information_schema/table_names.rs @@ -40,6 +40,6 @@ pub const GLOBAL_STATUS: &str = "global_status"; pub const SESSION_STATUS: &str = "session_status"; pub const RUNTIME_METRICS: &str = "runtime_metrics"; pub const PARTITIONS: &str = "partitions"; -pub const REGION_PEERS: &str = "greptime_region_peers"; +pub const REGION_PEERS: &str = "region_peers"; pub const TABLE_CONSTRAINTS: &str = "table_constraints"; pub const CLUSTER_INFO: &str = "cluster_info"; diff --git a/tests-integration/tests/region_migration.rs b/tests-integration/tests/region_migration.rs index 1ceb249978a2..adceb0243c26 100644 --- a/tests-integration/tests/region_migration.rs +++ b/tests-integration/tests/region_migration.rs @@ -854,17 +854,21 @@ async fn find_region_distribution_by_sql(cluster: &GreptimeDbCluster) -> RegionD let OutputData::Stream(stream) = run_sql( &cluster.frontend, - &format!(r#"select b.peer_id as datanode_id, + &format!( + r#"select b.peer_id as datanode_id, a.greptime_partition_id as region_id - from information_schema.partitions a left join information_schema.greptime_region_peers b + from information_schema.partitions a left join information_schema.region_peers b on a.greptime_partition_id = b.region_id where a.table_name='{TEST_TABLE_NAME}' order by datanode_id asc"# ), query_ctx.clone(), ) - .await.unwrap().data else { - unreachable!(); - }; + .await + .unwrap() + .data + else { + unreachable!(); + }; let recordbatches = RecordBatches::try_collect(stream).await.unwrap(); diff --git a/tests/cases/distributed/information_schema/cluster_info.result b/tests/cases/distributed/information_schema/cluster_info.result index 892c6be49878..2f54e7fafe16 100644 --- a/tests/cases/distributed/information_schema/cluster_info.result +++ b/tests/cases/distributed/information_schema/cluster_info.result @@ -21,17 +21,18 @@ DESC TABLE CLUSTER_INFO; -- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime -SELECT * FROM CLUSTER_INFO; +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime +SELECT * FROM CLUSTER_INFO ORDER BY peer_type; +---------+-----------+----------------+---------+------------+-------------------------+----------+ -| peer_id | peer_type | peer_addr | node_version | git_commit | start_time | uptime | +| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime| +---------+-----------+----------------+---------+------------+-------------------------+----------+ -| 0 | METASRV | 127.0.0.1:3002 | UNKNOWN | UNKNOWN | | | | 1 | DATANODE | 127.0.0.1:4101 |Version |Hash |Start_time|Uptime| -| 2 | DATANODE | 127.0.0.1:4102 |Version |Hash |Start_time|Uptime | +| 2 | DATANODE | 127.0.0.1:4102 |Version |Hash |Start_time|Uptime| | 3 | DATANODE | 127.0.0.1:4103 |Version |Hash |Start_time|Uptime| | 0 | FRONTEND | 127.0.0.1:4001 |Version |Hash |Start_time|Uptime | +| 0 | METASRV | 127.0.0.1:3002 | UNKNOWN | UNKNOWN | | | +---------+-----------+----------------+---------+------------+-------------------------+----------+ -- SQLNESS REPLACE version node_version @@ -39,11 +40,12 @@ SELECT * FROM CLUSTER_INFO; -- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime -SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'METASRV'; +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime +SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'METASRV' ORDER BY peer_type; +---------+-----------+----------------+---------+------------+------------+--------+ -| peer_id | peer_type | peer_addr | node_version | git_commit | start_time | uptime | +| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime| +---------+-----------+----------------+---------+------------+------------+--------+ | 0 | METASRV | 127.0.0.1:3002 | UNKNOWN | UNKNOWN | | | +---------+-----------+----------------+---------+------------+------------+--------+ @@ -53,11 +55,12 @@ SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'METASRV'; -- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime -SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'FRONTEND'; +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime +SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'FRONTEND' ORDER BY peer_type; +---------+-----------+----------------+---------+------------+-------------------------+--------+ -| peer_id | peer_type | peer_addr | node_version | git_commit | start_time | uptime | +| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime| +---------+-----------+----------------+---------+------------+-------------------------+--------+ | 0 | FRONTEND | 127.0.0.1:4001 |Version |Hash |Start_time|Uptime | +---------+-----------+----------------+---------+------------+-------------------------+--------+ @@ -67,16 +70,17 @@ SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'FRONTEND'; -- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime -SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'FRONTEND'; +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime +SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'FRONTEND' ORDER BY peer_type; +---------+-----------+----------------+---------+------------+-------------------------+----------+ -| peer_id | peer_type | peer_addr | node_version | git_commit | start_time | uptime | +| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime| +---------+-----------+----------------+---------+------------+-------------------------+----------+ -| 0 | METASRV | 127.0.0.1:3002 | UNKNOWN | UNKNOWN | | | | 1 | DATANODE | 127.0.0.1:4101 |Version |Hash |Start_time|Uptime| | 2 | DATANODE | 127.0.0.1:4102 |Version |Hash |Start_time|Uptime| | 3 | DATANODE | 127.0.0.1:4103 |Version |Hash |Start_time|Uptime| +| 0 | METASRV | 127.0.0.1:3002 | UNKNOWN | UNKNOWN | | | +---------+-----------+----------------+---------+------------+-------------------------+----------+ -- SQLNESS REPLACE version node_version @@ -84,11 +88,12 @@ SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'FRONTEND'; -- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime -SELECT * FROM CLUSTER_INFO WHERE PEER_ID > 1; +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime +SELECT * FROM CLUSTER_INFO WHERE PEER_ID > 1 ORDER BY peer_type; +---------+-----------+----------------+---------+------------+-------------------------+----------+ -| peer_id | peer_type | peer_addr | node_version | git_commit | start_time | uptime | +| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime| +---------+-----------+----------------+---------+------------+-------------------------+----------+ | 2 | DATANODE | 127.0.0.1:4102 |Version |Hash |Start_time|Uptime| | 3 | DATANODE | 127.0.0.1:4103 |Version |Hash |Start_time|Uptime| diff --git a/tests/cases/distributed/information_schema/cluster_info.sql b/tests/cases/distributed/information_schema/cluster_info.sql index 81e36b336425..7d04991b634e 100644 --- a/tests/cases/distributed/information_schema/cluster_info.sql +++ b/tests/cases/distributed/information_schema/cluster_info.sql @@ -7,39 +7,44 @@ DESC TABLE CLUSTER_INFO; -- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime -SELECT * FROM CLUSTER_INFO; +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime +SELECT * FROM CLUSTER_INFO ORDER BY peer_type; -- SQLNESS REPLACE version node_version -- SQLNESS REPLACE unknown UNKNOWN -- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime -SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'METASRV'; +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime +SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'METASRV' ORDER BY peer_type; -- SQLNESS REPLACE version node_version -- SQLNESS REPLACE unknown UNKNOWN -- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime -SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'FRONTEND'; +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime +SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'FRONTEND' ORDER BY peer_type; -- SQLNESS REPLACE version node_version -- SQLNESS REPLACE unknown UNKNOWN -- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime -SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'FRONTEND'; +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime +SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'FRONTEND' ORDER BY peer_type; -- SQLNESS REPLACE version node_version -- SQLNESS REPLACE unknown UNKNOWN -- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime -SELECT * FROM CLUSTER_INFO WHERE PEER_ID > 1; +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime +SELECT * FROM CLUSTER_INFO WHERE PEER_ID > 1 ORDER BY peer_type; USE PUBLIC; diff --git a/tests/cases/standalone/common/partition.result b/tests/cases/standalone/common/partition.result index 3d1c1359d81f..9c76a87df100 100644 --- a/tests/cases/standalone/common/partition.result +++ b/tests/cases/standalone/common/partition.result @@ -24,7 +24,7 @@ SELECT table_catalog, table_schema, table_name, partition_name, partition_expres -- SQLNESS REPLACE (\d{13}) REGION_ID -- SQLNESS REPLACE (\d{1}) PEER_ID -SELECT region_id, peer_id, is_leader, status FROM information_schema.greptime_region_peers ORDER BY peer_id; +SELECT region_id, peer_id, is_leader, status FROM information_schema.region_peers ORDER BY peer_id; +---------------+---------+-----------+--------+ | region_id | peer_id | is_leader | status | @@ -128,7 +128,7 @@ SELECT table_catalog, table_schema, table_name, partition_name, partition_expres -- SQLNESS REPLACE (\d{13}) REGION_ID -- SQLNESS REPLACE (\d{1}) PEER_ID -SELECT region_id, peer_id, is_leader, status FROM information_schema.greptime_region_peers ORDER BY peer_id; +SELECT region_id, peer_id, is_leader, status FROM information_schema.region_peers ORDER BY peer_id; +---------------+---------+-----------+--------+ | region_id | peer_id | is_leader | status | @@ -148,7 +148,6 @@ INSERT INTO my_table VALUES Affected Rows: 8 - SELECT * FROM my_table; +------+---+-------------------------+ diff --git a/tests/cases/standalone/common/partition.sql b/tests/cases/standalone/common/partition.sql index cc0c962743d7..3f75b293c332 100644 --- a/tests/cases/standalone/common/partition.sql +++ b/tests/cases/standalone/common/partition.sql @@ -14,7 +14,7 @@ SELECT table_catalog, table_schema, table_name, partition_name, partition_expres -- SQLNESS REPLACE (\d{13}) REGION_ID -- SQLNESS REPLACE (\d{1}) PEER_ID -SELECT region_id, peer_id, is_leader, status FROM information_schema.greptime_region_peers ORDER BY peer_id; +SELECT region_id, peer_id, is_leader, status FROM information_schema.region_peers ORDER BY peer_id; INSERT INTO my_table VALUES (100, 'a', 1), @@ -54,7 +54,7 @@ SELECT table_catalog, table_schema, table_name, partition_name, partition_expres -- SQLNESS REPLACE (\d{13}) REGION_ID -- SQLNESS REPLACE (\d{1}) PEER_ID -SELECT region_id, peer_id, is_leader, status FROM information_schema.greptime_region_peers ORDER BY peer_id; +SELECT region_id, peer_id, is_leader, status FROM information_schema.region_peers ORDER BY peer_id; INSERT INTO my_table VALUES (100, 'a', 1), @@ -65,7 +65,7 @@ INSERT INTO my_table VALUES (2100, 'f', 6), (2200, 'g', 7), (2400, 'h', 8); - + SELECT * FROM my_table; DROP TABLE my_table; diff --git a/tests/cases/standalone/common/show/show_databases_tables.result b/tests/cases/standalone/common/show/show_databases_tables.result index 61cd6c844317..e73d5b749def 100644 --- a/tests/cases/standalone/common/show/show_databases_tables.result +++ b/tests/cases/standalone/common/show/show_databases_tables.result @@ -20,6 +20,7 @@ show tables; | build_info | | character_sets | | check_constraints | +| cluster_info | | collation_character_set_applicability | | collations | | column_privileges | @@ -29,13 +30,13 @@ show tables; | events | | files | | global_status | -| greptime_region_peers | | key_column_usage | | optimizer_trace | | parameters | | partitions | | profiling | | referential_constraints | +| region_peers | | routines | | runtime_metrics | | schema_privileges | diff --git a/tests/cases/standalone/common/system/information_schema.result b/tests/cases/standalone/common/system/information_schema.result index ec99c88dbf09..bfda5392c1c8 100644 --- a/tests/cases/standalone/common/system/information_schema.result +++ b/tests/cases/standalone/common/system/information_schema.result @@ -25,13 +25,13 @@ order by table_schema, table_name; | greptime | information_schema | events | LOCAL TEMPORARY | 13 | | | greptime | information_schema | files | LOCAL TEMPORARY | 14 | | | greptime | information_schema | global_status | LOCAL TEMPORARY | 25 | | -| greptime | information_schema | greptime_region_peers | LOCAL TEMPORARY | 29 | | | greptime | information_schema | key_column_usage | LOCAL TEMPORARY | 16 | | | greptime | information_schema | optimizer_trace | LOCAL TEMPORARY | 17 | | | greptime | information_schema | parameters | LOCAL TEMPORARY | 18 | | | greptime | information_schema | partitions | LOCAL TEMPORARY | 28 | | | greptime | information_schema | profiling | LOCAL TEMPORARY | 19 | | | greptime | information_schema | referential_constraints | LOCAL TEMPORARY | 20 | | +| greptime | information_schema | region_peers | LOCAL TEMPORARY | 29 | | | greptime | information_schema | routines | LOCAL TEMPORARY | 21 | | | greptime | information_schema | runtime_metrics | LOCAL TEMPORARY | 27 | | | greptime | information_schema | schema_privileges | LOCAL TEMPORARY | 22 | | @@ -66,6 +66,8 @@ select * from information_schema.columns order by table_schema, table_name, colu | greptime | information_schema | cluster_info | peer_addr | 3 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | | greptime | information_schema | cluster_info | peer_id | 1 | | | 20 | 0 | | | | | | select,insert | | UInt64 | bigint unsigned | FIELD | | No | bigint unsigned | | | | greptime | information_schema | cluster_info | peer_type | 2 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | +| greptime | information_schema | cluster_info | start_time | 6 | | | | | 3 | | | | | select,insert | | TimestampMillisecond | timestamp(3) | FIELD | | Yes | timestamp(3) | | | +| greptime | information_schema | cluster_info | uptime | 7 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | | greptime | information_schema | cluster_info | version | 4 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | | greptime | information_schema | collation_character_set_applicability | character_set_name | 2 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | | greptime | information_schema | collation_character_set_applicability | collation_name | 1 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | @@ -180,12 +182,6 @@ select * from information_schema.columns order by table_schema, table_name, colu | greptime | information_schema | files | version | 25 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | | greptime | information_schema | global_status | variable_name | 1 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | | greptime | information_schema | global_status | variable_value | 2 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | -| greptime | information_schema | greptime_region_peers | down_seconds | 6 | | | 19 | 0 | | | | | | select,insert | | Int64 | bigint | FIELD | | Yes | bigint | | | -| greptime | information_schema | greptime_region_peers | is_leader | 4 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | -| greptime | information_schema | greptime_region_peers | peer_addr | 3 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | -| greptime | information_schema | greptime_region_peers | peer_id | 2 | | | 20 | 0 | | | | | | select,insert | | UInt64 | bigint unsigned | FIELD | | Yes | bigint unsigned | | | -| greptime | information_schema | greptime_region_peers | region_id | 1 | | | 20 | 0 | | | | | | select,insert | | UInt64 | bigint unsigned | FIELD | | No | bigint unsigned | | | -| greptime | information_schema | greptime_region_peers | status | 5 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | | greptime | information_schema | key_column_usage | column_name | 8 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | | greptime | information_schema | key_column_usage | constraint_catalog | 1 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | | greptime | information_schema | key_column_usage | constraint_name | 3 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | @@ -274,6 +270,12 @@ select * from information_schema.columns order by table_schema, table_name, colu | greptime | information_schema | referential_constraints | unique_constraint_name | 6 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | | greptime | information_schema | referential_constraints | unique_constraint_schema | 5 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | | greptime | information_schema | referential_constraints | update_rule | 8 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | +| greptime | information_schema | region_peers | down_seconds | 6 | | | 19 | 0 | | | | | | select,insert | | Int64 | bigint | FIELD | | Yes | bigint | | | +| greptime | information_schema | region_peers | is_leader | 4 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | +| greptime | information_schema | region_peers | peer_addr | 3 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | +| greptime | information_schema | region_peers | peer_id | 2 | | | 20 | 0 | | | | | | select,insert | | UInt64 | bigint unsigned | FIELD | | Yes | bigint unsigned | | | +| greptime | information_schema | region_peers | region_id | 1 | | | 20 | 0 | | | | | | select,insert | | UInt64 | bigint unsigned | FIELD | | No | bigint unsigned | | | +| greptime | information_schema | region_peers | status | 5 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | | greptime | information_schema | routines | character_maximum_length | 7 | | | 19 | 0 | | | | | | select,insert | | Int64 | bigint | FIELD | | No | bigint | | | | greptime | information_schema | routines | character_octet_length | 8 | | | 19 | 0 | | | | | | select,insert | | Int64 | bigint | FIELD | | No | bigint | | | | greptime | information_schema | routines | character_set_client | 29 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | @@ -689,7 +691,7 @@ DESC TABLE RUNTIME_METRICS; | timestamp | TimestampMillisecond | | NO | | FIELD | +-------------+----------------------+-----+------+---------+---------------+ -DESC TABLE GREPTIME_REGION_PEERS; +DESC TABLE REGION_PEERS; +--------------+--------+-----+------+---------+---------------+ | Column | Type | Key | Null | Default | Semantic Type | diff --git a/tests/cases/standalone/common/system/information_schema.sql b/tests/cases/standalone/common/system/information_schema.sql index d54c2c0ebd51..89db8514e5da 100644 --- a/tests/cases/standalone/common/system/information_schema.sql +++ b/tests/cases/standalone/common/system/information_schema.sql @@ -117,7 +117,7 @@ SELECT * FROM CHECK_CONSTRAINTS; DESC TABLE RUNTIME_METRICS; -DESC TABLE GREPTIME_REGION_PEERS; +DESC TABLE REGION_PEERS; USE INFORMATION_SCHEMA; diff --git a/tests/cases/standalone/information_schema/cluster_info.result b/tests/cases/standalone/information_schema/cluster_info.result index 445b158be953..85528369766e 100644 --- a/tests/cases/standalone/information_schema/cluster_info.result +++ b/tests/cases/standalone/information_schema/cluster_info.result @@ -20,11 +20,12 @@ DESC TABLE CLUSTER_INFO; -- SQLNESS REPLACE (\d\.\d\.\d) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime SELECT * FROM CLUSTER_INFO; +---------+------------+-----------+---------+------------+-------------------------+--------+ -| peer_id | peer_type | peer_addr | node_version | git_commit | start_time | uptime | +| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime| +---------+------------+-----------+---------+------------+-------------------------+--------+ | 0 | STANDALONE | | Version |Hash |Start_time|Uptime | +---------+------------+-----------+---------+------------+-------------------------+--------+ @@ -33,11 +34,12 @@ SELECT * FROM CLUSTER_INFO; -- SQLNESS REPLACE (\d\.\d\.\d) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'STANDALONE'; +---------+------------+-----------+---------+------------+-------------------------+--------+ -| peer_id | peer_type | peer_addr | node_version | git_commit | start_time | uptime | +| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime| +---------+------------+-----------+---------+------------+-------------------------+--------+ | 0 | STANDALONE | | Version |Hash |Start_time|Uptime | +---------+------------+-----------+---------+------------+-------------------------+--------+ @@ -51,11 +53,12 @@ SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'STANDALONE'; -- SQLNESS REPLACE (\d\.\d\.\d) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime SELECT * FROM CLUSTER_INFO WHERE PEER_ID = 0; +---------+------------+-----------+---------+------------+-------------------------+--------+ -| peer_id | peer_type | peer_addr | node_version | git_commit | start_time | uptime | +| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime| +---------+------------+-----------+---------+------------+-------------------------+--------+ | 0 | STANDALONE | | Version |Hash |Start_time|Uptime | +---------+------------+-----------+---------+------------+-------------------------+--------+ diff --git a/tests/cases/standalone/information_schema/cluster_info.sql b/tests/cases/standalone/information_schema/cluster_info.sql index d11f7affd595..7c31690a28fe 100644 --- a/tests/cases/standalone/information_schema/cluster_info.sql +++ b/tests/cases/standalone/information_schema/cluster_info.sql @@ -6,14 +6,16 @@ DESC TABLE CLUSTER_INFO; -- SQLNESS REPLACE (\d\.\d\.\d) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime SELECT * FROM CLUSTER_INFO; -- SQLNESS REPLACE version node_version -- SQLNESS REPLACE (\d\.\d\.\d) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'STANDALONE'; SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'STANDALONE'; @@ -22,7 +24,8 @@ SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'STANDALONE'; -- SQLNESS REPLACE (\d\.\d\.\d) Version -- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash -- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time --- SQLNESS REPLACE (\s(\d+(s|ms|m)\s)+) Uptime +-- SQLNESS REPLACE (\s+uptime\s+) uptime +-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime SELECT * FROM CLUSTER_INFO WHERE PEER_ID = 0; SELECT * FROM CLUSTER_INFO WHERE PEER_ID > 0;