diff --git a/Cargo.lock b/Cargo.lock index d32a4832b63d..9a0ee96bd5c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3929,6 +3929,7 @@ dependencies = [ "file-engine", "futures", "futures-util", + "hostname 0.4.1", "humantime-serde", "lazy_static", "log-store", @@ -4804,6 +4805,7 @@ dependencies = [ "futures", "get-size2", "greptime-proto", + "hostname 0.4.1", "http 1.3.1", "humantime-serde", "itertools 0.14.0", @@ -4920,6 +4922,7 @@ dependencies = [ "datanode", "datatypes", "futures", + "hostname 0.4.1", "humantime", "humantime-serde", "lazy_static", @@ -5325,7 +5328,7 @@ dependencies = [ [[package]] name = "greptime-proto" version = "0.1.0" -source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=d000eedd3739c003bb139aa42cefe05521a60f7d#d000eedd3739c003bb139aa42cefe05521a60f7d" +source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=710f1fa95cf68c1cf4e8b6d757bb418c4fddf4ed#710f1fa95cf68c1cf4e8b6d757bb418c4fddf4ed" dependencies = [ "prost 0.13.5", "prost-types 0.13.5", @@ -7412,6 +7415,7 @@ dependencies = [ "etcd-client", "futures", "h2 0.3.26", + "hostname 0.4.1", "http-body-util", "humantime", "humantime-serde", @@ -12363,6 +12367,7 @@ dependencies = [ "file-engine", "flow", "frontend", + "hostname 0.4.1", "log-store", "mito2", "query", diff --git a/Cargo.toml b/Cargo.toml index a9fafd232cd1..ca0eb1fa7a55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -147,7 +147,7 @@ etcd-client = { git = "https://github.com/GreptimeTeam/etcd-client", rev = "f62d fst = "0.4.7" futures = "0.3" futures-util = "0.3" -greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "d000eedd3739c003bb139aa42cefe05521a60f7d" } +greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "710f1fa95cf68c1cf4e8b6d757bb418c4fddf4ed" } hex = "0.4" http = "1" humantime = "2.1" @@ -207,6 +207,7 @@ rstest_reuse = "0.7" rust_decimal = "1.33" rustc-hash = "2.0" # It is worth noting that we should try to avoid using aws-lc-rs until it can be compiled on various platforms. +hostname = "0.4.0" rustls = { version = "0.23.25", default-features = false } sea-query = "0.32" serde = { version = "1.0", features = ["derive"] } diff --git a/src/catalog/src/system_schema/information_schema/cluster_info.rs b/src/catalog/src/system_schema/information_schema/cluster_info.rs index 4082629bd45f..861b7206dee0 100644 --- a/src/catalog/src/system_schema/information_schema/cluster_info.rs +++ b/src/catalog/src/system_schema/information_schema/cluster_info.rs @@ -50,6 +50,7 @@ const PEER_TYPE_METASRV: &str = "METASRV"; const PEER_ID: &str = "peer_id"; const PEER_TYPE: &str = "peer_type"; const PEER_ADDR: &str = "peer_addr"; +const PEER_HOSTNAME: &str = "peer_hostname"; const CPUS: &str = "cpus"; const MEMORY_BYTES: &str = "memory_bytes"; const VERSION: &str = "version"; @@ -74,6 +75,7 @@ const INIT_CAPACITY: usize = 42; /// - `uptime`: the uptime of the peer. /// - `active_time`: the time since the last activity of the peer. /// - `node_status`: the status info of the peer. +/// - `peer_hostname`: the hostname of the peer. /// #[derive(Debug)] pub(super) struct InformationSchemaClusterInfo { @@ -94,6 +96,7 @@ impl InformationSchemaClusterInfo { ColumnSchema::new(PEER_ID, ConcreteDataType::int64_datatype(), false), ColumnSchema::new(PEER_TYPE, ConcreteDataType::string_datatype(), false), ColumnSchema::new(PEER_ADDR, ConcreteDataType::string_datatype(), true), + ColumnSchema::new(PEER_HOSTNAME, ConcreteDataType::string_datatype(), true), ColumnSchema::new(CPUS, ConcreteDataType::uint32_datatype(), false), ColumnSchema::new(MEMORY_BYTES, ConcreteDataType::uint64_datatype(), false), ColumnSchema::new(VERSION, ConcreteDataType::string_datatype(), false), @@ -155,6 +158,7 @@ struct InformationSchemaClusterInfoBuilder { peer_ids: Int64VectorBuilder, peer_types: StringVectorBuilder, peer_addrs: StringVectorBuilder, + peer_hostnames: StringVectorBuilder, cpus: UInt32VectorBuilder, memory_bytes: UInt64VectorBuilder, versions: StringVectorBuilder, @@ -173,6 +177,7 @@ impl InformationSchemaClusterInfoBuilder { peer_ids: Int64VectorBuilder::with_capacity(INIT_CAPACITY), peer_types: StringVectorBuilder::with_capacity(INIT_CAPACITY), peer_addrs: StringVectorBuilder::with_capacity(INIT_CAPACITY), + peer_hostnames: StringVectorBuilder::with_capacity(INIT_CAPACITY), cpus: UInt32VectorBuilder::with_capacity(INIT_CAPACITY), memory_bytes: UInt64VectorBuilder::with_capacity(INIT_CAPACITY), versions: StringVectorBuilder::with_capacity(INIT_CAPACITY), @@ -203,6 +208,7 @@ impl InformationSchemaClusterInfoBuilder { (PEER_ID, &Value::from(peer_id)), (PEER_TYPE, &Value::from(peer_type)), (PEER_ADDR, &Value::from(node_info.peer.addr.as_str())), + (PEER_HOSTNAME, &Value::from(node_info.hostname.as_str())), (VERSION, &Value::from(node_info.version.as_str())), (GIT_COMMIT, &Value::from(node_info.git_commit.as_str())), ]; @@ -214,6 +220,7 @@ impl InformationSchemaClusterInfoBuilder { self.peer_ids.push(Some(peer_id)); self.peer_types.push(Some(peer_type)); self.peer_addrs.push(Some(&node_info.peer.addr)); + self.peer_hostnames.push(Some(&node_info.hostname)); self.versions.push(Some(&node_info.version)); self.git_commits.push(Some(&node_info.git_commit)); if node_info.start_time_ms > 0 { @@ -253,6 +260,7 @@ impl InformationSchemaClusterInfoBuilder { Arc::new(self.peer_ids.finish()), Arc::new(self.peer_types.finish()), Arc::new(self.peer_addrs.finish()), + Arc::new(self.peer_hostnames.finish()), Arc::new(self.cpus.finish()), Arc::new(self.memory_bytes.finish()), Arc::new(self.versions.finish()), diff --git a/src/common/meta/src/cluster.rs b/src/common/meta/src/cluster.rs index c7820477b7bb..63001970b6ae 100644 --- a/src/common/meta/src/cluster.rs +++ b/src/common/meta/src/cluster.rs @@ -124,6 +124,9 @@ pub struct NodeInfo { // The node build memory bytes #[serde(default)] pub memory_bytes: u64, + // The node build hostname + #[serde(default)] + pub hostname: String, } #[derive(Debug, Clone, Copy, Eq, Hash, PartialEq, Serialize, Deserialize)] @@ -332,6 +335,7 @@ mod tests { start_time_ms: 1, cpus: 0, memory_bytes: 0, + hostname: "test_hostname".to_string(), }; let node_info_bytes: Vec = node_info.try_into().unwrap(); diff --git a/src/datanode/Cargo.toml b/src/datanode/Cargo.toml index 0abbefa76e37..b9728af50bd6 100644 --- a/src/datanode/Cargo.toml +++ b/src/datanode/Cargo.toml @@ -43,6 +43,7 @@ datatypes.workspace = true file-engine.workspace = true futures.workspace = true futures-util.workspace = true +hostname.workspace = true humantime-serde.workspace = true lazy_static.workspace = true log-store.workspace = true diff --git a/src/datanode/src/heartbeat.rs b/src/datanode/src/heartbeat.rs index 5b8fa4c1e31c..bb3f25957c2a 100644 --- a/src/datanode/src/heartbeat.rs +++ b/src/datanode/src/heartbeat.rs @@ -251,6 +251,10 @@ impl HeartbeatTask { start_time_ms: node_epoch, cpus, memory_bytes, + hostname: hostname::get() + .unwrap_or_default() + .to_string_lossy() + .to_string(), }), node_workloads: Some(NodeWorkloads::Datanode(DatanodeWorkloads { types: workload_types.iter().map(|w| w.to_i32()).collect(), diff --git a/src/flow/Cargo.toml b/src/flow/Cargo.toml index 9e0204d91736..7da961084434 100644 --- a/src/flow/Cargo.toml +++ b/src/flow/Cargo.toml @@ -48,6 +48,7 @@ enum_dispatch = "0.3" futures.workspace = true get-size2 = "0.1.2" greptime-proto.workspace = true +hostname.workspace = true http.workspace = true humantime-serde.workspace = true itertools.workspace = true diff --git a/src/flow/src/heartbeat.rs b/src/flow/src/heartbeat.rs index 62db52444f48..cc42668f5a00 100644 --- a/src/flow/src/heartbeat.rs +++ b/src/flow/src/heartbeat.rs @@ -185,6 +185,10 @@ impl HeartbeatTask { start_time_ms, cpus, memory_bytes, + hostname: hostname::get() + .unwrap_or_default() + .to_string_lossy() + .to_string(), }) } diff --git a/src/frontend/Cargo.toml b/src/frontend/Cargo.toml index bf6b6bd25d92..db26316c39f5 100644 --- a/src/frontend/Cargo.toml +++ b/src/frontend/Cargo.toml @@ -46,6 +46,7 @@ datafusion-expr.workspace = true datanode.workspace = true datatypes.workspace = true futures.workspace = true +hostname.workspace = true humantime.workspace = true humantime-serde.workspace = true lazy_static.workspace = true diff --git a/src/frontend/src/heartbeat.rs b/src/frontend/src/heartbeat.rs index 59514f7da48b..76fdc3305bdf 100644 --- a/src/frontend/src/heartbeat.rs +++ b/src/frontend/src/heartbeat.rs @@ -158,6 +158,10 @@ impl HeartbeatTask { start_time_ms, cpus, memory_bytes, + hostname: hostname::get() + .unwrap_or_default() + .to_string_lossy() + .to_string(), }) } diff --git a/src/meta-client/src/client.rs b/src/meta-client/src/client.rs index 9091156f5ca7..2a66c1570af5 100644 --- a/src/meta-client/src/client.rs +++ b/src/meta-client/src/client.rs @@ -353,6 +353,8 @@ impl ProcedureExecutor for MetaClient { } } +// TODO(zyy17): Allow deprecated fields for backward compatibility. Remove this when the deprecated fields are removed from the proto. +#[allow(deprecated)] #[async_trait::async_trait] impl ClusterInfo for MetaClient { type Error = Error; @@ -372,25 +374,61 @@ impl ClusterInfo for MetaClient { let (leader, followers) = cluster_client.get_metasrv_peers().await?; followers .into_iter() - .map(|node| NodeInfo { - peer: node.peer.unwrap_or_default(), - last_activity_ts, - status: NodeStatus::Metasrv(MetasrvStatus { is_leader: false }), - version: node.version, - git_commit: node.git_commit, - start_time_ms: node.start_time_ms, - cpus: node.cpus, - memory_bytes: node.memory_bytes, + .map(|node| { + if let Some(node_info) = node.info { + NodeInfo { + peer: node.peer.unwrap_or_default(), + last_activity_ts, + status: NodeStatus::Metasrv(MetasrvStatus { is_leader: false }), + version: node_info.version, + git_commit: node_info.git_commit, + start_time_ms: node_info.start_time_ms, + cpus: node_info.cpus, + memory_bytes: node_info.memory_bytes, + hostname: node_info.hostname, + } + } else { + // TODO(zyy17): It's for backward compatibility. Remove this when the deprecated fields are removed from the proto. + NodeInfo { + peer: node.peer.unwrap_or_default(), + last_activity_ts, + status: NodeStatus::Metasrv(MetasrvStatus { is_leader: false }), + version: node.version, + git_commit: node.git_commit, + start_time_ms: node.start_time_ms, + cpus: node.cpus, + memory_bytes: node.memory_bytes, + hostname: "".to_string(), + } + } }) - .chain(leader.into_iter().map(|node| NodeInfo { - peer: node.peer.unwrap_or_default(), - last_activity_ts, - status: NodeStatus::Metasrv(MetasrvStatus { is_leader: true }), - version: node.version, - git_commit: node.git_commit, - start_time_ms: node.start_time_ms, - cpus: node.cpus, - memory_bytes: node.memory_bytes, + .chain(leader.into_iter().map(|node| { + if let Some(node_info) = node.info { + NodeInfo { + peer: node.peer.unwrap_or_default(), + last_activity_ts, + status: NodeStatus::Metasrv(MetasrvStatus { is_leader: true }), + version: node_info.version, + git_commit: node_info.git_commit, + start_time_ms: node_info.start_time_ms, + cpus: node_info.cpus, + memory_bytes: node_info.memory_bytes, + hostname: node_info.hostname, + } + } else { + // TODO(zyy17): It's for backward compatibility. Remove this when the deprecated fields are removed from the proto. + NodeInfo { + peer: node.peer.unwrap_or_default(), + last_activity_ts, + status: NodeStatus::Metasrv(MetasrvStatus { is_leader: true }), + version: node.version, + git_commit: node.git_commit, + start_time_ms: node.start_time_ms, + cpus: node.cpus, + memory_bytes: node.memory_bytes, + hostname: "".to_string(), + } + } })) .collect::>() } else { diff --git a/src/meta-srv/Cargo.toml b/src/meta-srv/Cargo.toml index b521ddad6cff..90a4fdc17b80 100644 --- a/src/meta-srv/Cargo.toml +++ b/src/meta-srv/Cargo.toml @@ -53,6 +53,7 @@ either.workspace = true etcd-client.workspace = true futures.workspace = true h2 = "0.3" +hostname.workspace = true http-body-util = "0.1" humantime.workspace = true humantime-serde.workspace = true diff --git a/src/meta-srv/src/discovery/lease.rs b/src/meta-srv/src/discovery/lease.rs index 557437964e54..46b92c0f1ae6 100644 --- a/src/meta-srv/src/discovery/lease.rs +++ b/src/meta-srv/src/discovery/lease.rs @@ -245,6 +245,7 @@ mod tests { start_time_ms: current_time_millis() as u64, cpus: 0, memory_bytes: 0, + hostname: "test_hostname".to_string(), }; let key_prefix = NodeInfoKey::key_prefix_with_role(Role::Frontend); @@ -270,6 +271,7 @@ mod tests { start_time_ms: current_time_millis() as u64, cpus: 0, memory_bytes: 0, + hostname: "test_hostname".to_string(), }; in_memory @@ -307,6 +309,7 @@ mod tests { start_time_ms: last_activity_ts as u64, cpus: 0, memory_bytes: 0, + hostname: "test_hostname".to_string(), }; let key_prefix = NodeInfoKey::key_prefix_with_role(Role::Frontend); diff --git a/src/meta-srv/src/election/rds/mysql.rs b/src/meta-srv/src/election/rds/mysql.rs index 6737f40054ce..a0890969f86c 100644 --- a/src/meta-srv/src/election/rds/mysql.rs +++ b/src/meta-srv/src/election/rds/mysql.rs @@ -1163,6 +1163,7 @@ mod tests { start_time_ms: 0, cpus: 0, memory_bytes: 0, + hostname: "test_hostname".to_string(), }; mysql_election.register_candidate(&node_info).await.unwrap(); } diff --git a/src/meta-srv/src/election/rds/postgres.rs b/src/meta-srv/src/election/rds/postgres.rs index f577cc111ab0..14b2bbb40986 100644 --- a/src/meta-srv/src/election/rds/postgres.rs +++ b/src/meta-srv/src/election/rds/postgres.rs @@ -1002,6 +1002,7 @@ mod tests { start_time_ms: 0, cpus: 0, memory_bytes: 0, + hostname: "test_hostname".to_string(), }; pg_election.register_candidate(&node_info).await.unwrap(); } diff --git a/src/meta-srv/src/handler/collect_cluster_info_handler.rs b/src/meta-srv/src/handler/collect_cluster_info_handler.rs index 8ce24e86368a..f144f3edc5dc 100644 --- a/src/meta-srv/src/handler/collect_cluster_info_handler.rs +++ b/src/meta-srv/src/handler/collect_cluster_info_handler.rs @@ -54,6 +54,7 @@ impl HeartbeatHandler for CollectFrontendClusterInfoHandler { start_time_ms: info.start_time_ms, cpus: info.cpus, memory_bytes: info.memory_bytes, + hostname: info.hostname, }; put_into_memory_store(ctx, key, value).await?; @@ -89,6 +90,7 @@ impl HeartbeatHandler for CollectFlownodeClusterInfoHandler { start_time_ms: info.start_time_ms, cpus: info.cpus, memory_bytes: info.memory_bytes, + hostname: info.hostname, }; put_into_memory_store(ctx, key, value).await?; @@ -142,6 +144,7 @@ impl HeartbeatHandler for CollectDatanodeClusterInfoHandler { start_time_ms: info.start_time_ms, cpus: info.cpus, memory_bytes: info.memory_bytes, + hostname: info.hostname, }; put_into_memory_store(ctx, key, value).await?; diff --git a/src/meta-srv/src/metasrv.rs b/src/meta-srv/src/metasrv.rs index 615e75d3178d..4c2c7fcf5339 100644 --- a/src/meta-srv/src/metasrv.rs +++ b/src/meta-srv/src/metasrv.rs @@ -375,11 +375,16 @@ pub struct MetasrvNodeInfo { // The node cpus #[serde(default)] pub cpus: u32, - #[serde(default)] // The node memory bytes + #[serde(default)] pub memory_bytes: u64, + // The node hostname + #[serde(default)] + pub hostname: String, } +// TODO(zyy17): Allow deprecated fields for backward compatibility. Remove this when the deprecated top-level fields are removed from the proto. +#[allow(deprecated)] impl From for api::v1::meta::MetasrvNodeInfo { fn from(node_info: MetasrvNodeInfo) -> Self { Self { @@ -387,11 +392,22 @@ impl From for api::v1::meta::MetasrvNodeInfo { addr: node_info.addr, ..Default::default() }), - version: node_info.version, - git_commit: node_info.git_commit, + // TODO(zyy17): The following top-level fields are deprecated. They are kept for backward compatibility and will be removed in a future version. + // New code should use the fields in `info.NodeInfo` instead. + version: node_info.version.clone(), + git_commit: node_info.git_commit.clone(), start_time_ms: node_info.start_time_ms, cpus: node_info.cpus, memory_bytes: node_info.memory_bytes, + // The canonical location for node information. + info: Some(api::v1::meta::NodeInfo { + version: node_info.version, + git_commit: node_info.git_commit, + start_time_ms: node_info.start_time_ms, + cpus: node_info.cpus, + memory_bytes: node_info.memory_bytes, + hostname: node_info.hostname, + }), } } } @@ -696,6 +712,10 @@ impl Metasrv { start_time_ms: self.start_time_ms(), cpus: self.resource_spec().cpus as u32, memory_bytes: self.resource_spec().memory.unwrap_or_default().as_bytes(), + hostname: hostname::get() + .unwrap_or_default() + .to_string_lossy() + .to_string(), } } diff --git a/src/meta-srv/src/service/cluster.rs b/src/meta-srv/src/service/cluster.rs index 392268ff6d35..e39337c37466 100644 --- a/src/meta-srv/src/service/cluster.rs +++ b/src/meta-srv/src/service/cluster.rs @@ -99,6 +99,10 @@ impl Metasrv { start_time_ms: self.start_time_ms(), cpus: self.resource_spec().cpus as u32, memory_bytes: self.resource_spec().memory.unwrap_or_default().as_bytes(), + hostname: hostname::get() + .unwrap_or_default() + .to_string_lossy() + .to_string(), } .into() } diff --git a/src/standalone/Cargo.toml b/src/standalone/Cargo.toml index 035b1dc06a54..bc97b707c245 100644 --- a/src/standalone/Cargo.toml +++ b/src/standalone/Cargo.toml @@ -27,6 +27,7 @@ datanode.workspace = true file-engine.workspace = true flow.workspace = true frontend.workspace = true +hostname.workspace = true log-store.workspace = true mito2.workspace = true query.workspace = true diff --git a/src/standalone/src/information_extension.rs b/src/standalone/src/information_extension.rs index 347955cfab85..83441460fb1e 100644 --- a/src/standalone/src/information_extension.rs +++ b/src/standalone/src/information_extension.rs @@ -79,6 +79,10 @@ impl InformationExtension for StandaloneInformationExtension { memory_bytes: common_config::utils::get_sys_total_memory() .unwrap_or_default() .as_bytes(), + hostname: hostname::get() + .unwrap_or_default() + .to_string_lossy() + .to_string(), }; Ok(vec![node_info]) } diff --git a/tests/cases/distributed/information_schema/cluster_info.result b/tests/cases/distributed/information_schema/cluster_info.result index 76875e564102..43cb854c6dde 100644 --- a/tests/cases/distributed/information_schema/cluster_info.result +++ b/tests/cases/distributed/information_schema/cluster_info.result @@ -4,21 +4,22 @@ Affected Rows: 0 DESC TABLE CLUSTER_INFO; -+--------------+----------------------+-----+------+---------+---------------+ -| Column | Type | Key | Null | Default | Semantic Type | -+--------------+----------------------+-----+------+---------+---------------+ -| peer_id | Int64 | | NO | | FIELD | -| peer_type | String | | NO | | FIELD | -| peer_addr | String | | YES | | FIELD | -| cpus | UInt32 | | NO | | FIELD | -| memory_bytes | UInt64 | | NO | | FIELD | -| version | String | | NO | | FIELD | -| git_commit | String | | NO | | FIELD | -| start_time | TimestampMillisecond | | YES | | FIELD | -| uptime | String | | YES | | FIELD | -| active_time | String | | YES | | FIELD | -| node_status | String | | YES | | FIELD | -+--------------+----------------------+-----+------+---------+---------------+ ++---------------+----------------------+-----+------+---------+---------------+ +| Column | Type | Key | Null | Default | Semantic Type | ++---------------+----------------------+-----+------+---------+---------------+ +| peer_id | Int64 | | NO | | FIELD | +| peer_type | String | | NO | | FIELD | +| peer_addr | String | | YES | | FIELD | +| peer_hostname | String | | YES | | FIELD | +| cpus | UInt32 | | NO | | FIELD | +| memory_bytes | UInt64 | | NO | | FIELD | +| version | String | | NO | | FIELD | +| git_commit | String | | NO | | FIELD | +| start_time | TimestampMillisecond | | YES | | FIELD | +| uptime | String | | YES | | FIELD | +| active_time | String | | YES | | FIELD | +| node_status | String | | YES | | FIELD | ++---------------+----------------------+-----+------+---------+---------------+ -- SQLNESS REPLACE version node_version -- SQLNESS REPLACE (\s\d+\.\d+(?:\.\d+)+\s) Version diff --git a/tests/cases/standalone/common/system/information_schema.result b/tests/cases/standalone/common/system/information_schema.result index 541a90f423c5..079ce6440cbf 100644 --- a/tests/cases/standalone/common/system/information_schema.result +++ b/tests/cases/standalone/common/system/information_schema.result @@ -71,17 +71,18 @@ select * from information_schema.columns order by table_schema, table_name, colu | greptime | information_schema | check_constraints | constraint_catalog | 1 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | | greptime | information_schema | check_constraints | constraint_name | 3 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | | greptime | information_schema | check_constraints | constraint_schema | 2 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | -| greptime | information_schema | cluster_info | active_time | 10 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | -| greptime | information_schema | cluster_info | cpus | 4 | | | 10 | 0 | | | | | | select,insert | | UInt32 | int unsigned | FIELD | | No | int unsigned | | | -| greptime | information_schema | cluster_info | git_commit | 7 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | -| greptime | information_schema | cluster_info | memory_bytes | 5 | | | 20 | 0 | | | | | | select,insert | | UInt64 | bigint unsigned | FIELD | | No | bigint unsigned | | | -| greptime | information_schema | cluster_info | node_status | 11 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | +| greptime | information_schema | cluster_info | active_time | 11 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | +| greptime | information_schema | cluster_info | cpus | 5 | | | 10 | 0 | | | | | | select,insert | | UInt32 | int unsigned | FIELD | | No | int unsigned | | | +| greptime | information_schema | cluster_info | git_commit | 8 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | +| greptime | information_schema | cluster_info | memory_bytes | 6 | | | 20 | 0 | | | | | | select,insert | | UInt64 | bigint unsigned | FIELD | | No | bigint unsigned | | | +| greptime | information_schema | cluster_info | node_status | 12 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | | 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_hostname | 4 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | | greptime | information_schema | cluster_info | peer_id | 1 | | | 19 | 0 | | | | | | select,insert | | Int64 | bigint | FIELD | | No | bigint | | | | 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 | 8 | | | | | 3 | | | | | select,insert | | TimestampMillisecond | timestamp(3) | FIELD | | Yes | timestamp(3) | | | -| greptime | information_schema | cluster_info | uptime | 9 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | -| greptime | information_schema | cluster_info | version | 6 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | +| greptime | information_schema | cluster_info | start_time | 9 | | | | | 3 | | | | | select,insert | | TimestampMillisecond | timestamp(3) | FIELD | | Yes | timestamp(3) | | | +| greptime | information_schema | cluster_info | uptime | 10 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | Yes | string | | | +| greptime | information_schema | cluster_info | version | 7 | 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 | | | | greptime | information_schema | collations | character_set_name | 2 | 2147483647 | 2147483647 | | | | utf8 | utf8_bin | | | select,insert | | String | string | FIELD | | No | string | | | diff --git a/tests/cases/standalone/information_schema/cluster_info.result b/tests/cases/standalone/information_schema/cluster_info.result index 674d687cac79..6625007a3543 100644 --- a/tests/cases/standalone/information_schema/cluster_info.result +++ b/tests/cases/standalone/information_schema/cluster_info.result @@ -4,21 +4,22 @@ Affected Rows: 0 DESC TABLE CLUSTER_INFO; -+--------------+----------------------+-----+------+---------+---------------+ -| Column | Type | Key | Null | Default | Semantic Type | -+--------------+----------------------+-----+------+---------+---------------+ -| peer_id | Int64 | | NO | | FIELD | -| peer_type | String | | NO | | FIELD | -| peer_addr | String | | YES | | FIELD | -| cpus | UInt32 | | NO | | FIELD | -| memory_bytes | UInt64 | | NO | | FIELD | -| version | String | | NO | | FIELD | -| git_commit | String | | NO | | FIELD | -| start_time | TimestampMillisecond | | YES | | FIELD | -| uptime | String | | YES | | FIELD | -| active_time | String | | YES | | FIELD | -| node_status | String | | YES | | FIELD | -+--------------+----------------------+-----+------+---------+---------------+ ++---------------+----------------------+-----+------+---------+---------------+ +| Column | Type | Key | Null | Default | Semantic Type | ++---------------+----------------------+-----+------+---------+---------------+ +| peer_id | Int64 | | NO | | FIELD | +| peer_type | String | | NO | | FIELD | +| peer_addr | String | | YES | | FIELD | +| peer_hostname | String | | YES | | FIELD | +| cpus | UInt32 | | NO | | FIELD | +| memory_bytes | UInt64 | | NO | | FIELD | +| version | String | | NO | | FIELD | +| git_commit | String | | NO | | FIELD | +| start_time | TimestampMillisecond | | YES | | FIELD | +| uptime | String | | YES | | FIELD | +| active_time | String | | YES | | FIELD | +| node_status | String | | YES | | FIELD | ++---------------+----------------------+-----+------+---------+---------------+ -- SQLNESS REPLACE version node_version -- SQLNESS REPLACE (\d+\.\d+(?:\.\d+)+) Version