Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cluster information #3631

Merged
merged 13 commits into from Apr 8, 2024
Merged

Conversation

fengjiachun
Copy link
Collaborator

@fengjiachun fengjiachun commented Apr 2, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

Close #3294 , allow meta client to get some information of all nodes in the cluster, the implementation is divided into the following steps:

  1. Two new heartbeat request handlers have been added: CollectDatanodeClusterInfoHandler and CollectFrontendClusterInfoHandler, which are used to process heartbeats requests from datanodes and frontends. These handlers extract information and write it into the in-memory KV storage on the metasrv leader node.
  2. The cluster client access Metasrv's in-memory KV based on gRPC Service with read-only mode, offering range and batch_get APIs.
  3. Implement the ClusterInfo trait for the cluster client, and implement the list_nodes method based on the kv service to return information about all node states.

Other: The information for the Metasrv node will not be included in this PR as it is about to exceed 1000 lines.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

@fengjiachun fengjiachun changed the title feat: cluster info feat: cluster inforomation Apr 2, 2024
@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Apr 2, 2024
@fengjiachun fengjiachun changed the title feat: cluster inforomation feat: cluster information Apr 2, 2024
@fengjiachun fengjiachun marked this pull request as draft April 2, 2024 09:39
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 63.83442% with 166 lines in your changes are missing coverage. Please review.

Project coverage is 84.80%. Comparing base (097a037) to head (40f5dd2).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3631      +/-   ##
==========================================
- Coverage   85.14%   84.80%   -0.35%     
==========================================
  Files         943      946       +3     
  Lines      157092   157547     +455     
==========================================
- Hits       133754   133604     -150     
- Misses      23338    23943     +605     

@fengjiachun fengjiachun force-pushed the feat/cluster-info branch 3 times, most recently from 544cceb to 9f481e0 Compare April 7, 2024 04:13
@fengjiachun fengjiachun marked this pull request as ready for review April 7, 2024 12:43
src/meta-srv/src/error.rs Outdated Show resolved Hide resolved
src/common/meta/src/cluster.rs Show resolved Hide resolved
src/common/meta/src/cluster.rs Outdated Show resolved Hide resolved
src/common/meta/src/cluster.rs Outdated Show resolved Hide resolved
src/common/meta/src/error.rs Outdated Show resolved Hide resolved
src/common/meta/src/util.rs Outdated Show resolved Hide resolved
src/meta-client/src/client.rs Show resolved Hide resolved
@fengjiachun
Copy link
Collaborator Author

The comments have all been resolved, please take a look @killme2008 @MichaelScofield

Copy link
Contributor

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

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

LGTM

@fengjiachun fengjiachun added this pull request to the merge queue Apr 8, 2024
Merged via the queue into GreptimeTeam:main with commit 12286f0 Apr 8, 2024
19 checks passed
@fengjiachun fengjiachun deleted the feat/cluster-info branch April 8, 2024 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Needs a way to find all peers info in cluster
3 participants