-
Notifications
You must be signed in to change notification settings - Fork 32
feat: admin gc #308
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
base: main
Are you sure you want to change the base?
feat: admin gc #308
Conversation
Signed-off-by: discord9 <[email protected]>
Summary of ChangesHello @discord9, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the metadata service by introducing new administrative garbage collection functionalities. It provides dedicated gRPC endpoints and data structures for triggering GC operations on either a specific set of regions or an entire table, allowing for more granular control over data cleanup and maintenance. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces new gRPC endpoints for administrative garbage collection, specifically for regions and tables. The changes are primarily in the protobuf definitions, with corresponding updates to the generated C++ and Go code. My review focuses on the protobuf definitions, where I've identified an opportunity to reduce code duplication in the response messages for better maintainability.
| message GcTableResponse { | ||
| ResponseHeader header = 1; | ||
| // Number of regions requested for GC (accepted by the server side). | ||
| uint64 processed_regions = 2; | ||
| // Regions that need retry in the next GC round. | ||
| repeated uint64 need_retry_regions = 3; | ||
| // Number of deleted SST files. | ||
| uint64 deleted_files = 4; | ||
| // Number of deleted index files. | ||
| uint64 deleted_indexes = 5; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GcTableResponse is identical to GcRegionsResponse. To improve maintainability and reduce code duplication, I suggest extracting the common fields into a shared GcStats message. Both GcRegionsResponse and GcTableResponse can then embed this new message.
Here's a suggested implementation:
message GcStats {
// Number of regions requested for GC (accepted by the server side).
uint64 processed_regions = 1;
// Regions that need retry in the next GC round.
repeated uint64 need_retry_regions = 2;
// Number of deleted SST files.
uint64 deleted_files = 3;
// Number of deleted index files.
uint64 deleted_indexes = 4;
}
message GcRegionsResponse {
ResponseHeader header = 1;
GcStats stats = 2;
}
message GcTableResponse {
ResponseHeader header = 1;
GcStats stats = 2;
}Signed-off-by: discord9 <[email protected]>
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?
as title
Please explain IN DETAIL what the changes are in this PR and why they are needed:
Checklist