Skip to content

Conversation

WenyXu
Copy link
Member

@WenyXu WenyXu commented Sep 3, 2025

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

close #6895

What's changed and what's your intention?

Add CPU, memory and node status information to the cluster_info table.

mysql> select peer_id, peer_type, cpus, memory_bytes, node_status from cluster_info;
+---------+-----------+------+--------------+-------------------------------------------------------------------+
| peer_id | peer_type | cpus | memory_bytes | node_status                                                       |
+---------+-----------+------+--------------+-------------------------------------------------------------------+
|      -1 | METASRV   |    2 |   1999998976 | NULL                                                              |
|      -1 | METASRV   |    2 |   1999998976 | {"is_leader":true}                                                |
|       0 | DATANODE  |    8 |  17179869184 | {"workloads":["hybrid"],"leader_regions":46,"follower_regions":0} |
|       1 | DATANODE  |    8 |  17179869184 | {"workloads":["hybrid"],"leader_regions":45,"follower_regions":0} |
|      -1 | FRONTEND  |    4 |   3999997952 | NULL                                                              |
|      -1 | FRONTEND  |    4 |   3999997952 | NULL                                                              |
|       0 | FLOWNODE  |   16 |  46053543936 | NULL                                                              |
+---------+-----------+------+--------------+-------------------------------------------------------------------+

PR Checklist

Please convert it to a draft if some of the following conditions are not met.

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.
  • API changes are backward compatible.
  • Schema or data changes are backward compatible.

@github-actions github-actions bot added size/S docs-not-required This change does not impact docs. labels Sep 3, 2025
@killme2008
Copy link
Contributor

It's better to add a new cluster_statistics table.

@WenyXu
Copy link
Member Author

WenyXu commented Sep 4, 2025

It's better to add a new cluster_statistics table.

I think statistics is usually for values that change over time, so static info like CPU and memory makes more sense in an info table.

@killme2008
Copy link
Contributor

It's better to add a new cluster_statistics table.

I think statistics is usually for values that change over time, so static info like CPU and memory makes more sense in an info table.

Got it. I thought they are utilization of cpu or memroy.

@github-actions github-actions bot added docs-required This change requires docs update. and removed docs-not-required This change does not impact docs. labels Sep 5, 2025
@github-actions github-actions bot added docs-not-required This change does not impact docs. and removed docs-required This change requires docs update. labels Sep 5, 2025
@WenyXu WenyXu force-pushed the feat/cluster-info-cpu-mem branch from 2b65c05 to eced283 Compare September 5, 2025 08:04
@github-actions github-actions bot added size/M and removed size/S labels Sep 5, 2025
@WenyXu WenyXu force-pushed the feat/cluster-info-cpu-mem branch from eced283 to 5072c91 Compare September 5, 2025 08:11
@WenyXu WenyXu requested a review from fengjiachun September 5, 2025 08:20
@WenyXu WenyXu changed the title feat: add CPU and memory info to cluster_info feat: add CPU, memory and node status info to cluster_info Sep 5, 2025
@github-actions github-actions bot added docs-required This change requires docs update. and removed docs-not-required This change does not impact docs. labels Sep 5, 2025
@WenyXu WenyXu marked this pull request as ready for review September 5, 2025 08:50
Copy link
Collaborator

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others LGTM

@WenyXu WenyXu force-pushed the feat/cluster-info-cpu-mem branch from 432a57f to 45035fe Compare September 8, 2025 08:00
Signed-off-by: WenyXu <[email protected]>
@WenyXu WenyXu enabled auto-merge September 8, 2025 08:33
@WenyXu WenyXu added this pull request to the merge queue Sep 8, 2025
Merged via the queue into GreptimeTeam:main with commit 16febbd Sep 8, 2025
42 checks passed
@WenyXu WenyXu deleted the feat/cluster-info-cpu-mem branch September 8, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-required This change requires docs update. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more peer information in information_schema.cluster_info
4 participants