fix(mito2): introduce PartitionExprChange in staging flow and keep memtables on metadata-only updates#7695
Conversation
Signed-off-by: WenyXu <wenymedia@gmail.com>
…manager Signed-off-by: WenyXu <wenymedia@gmail.com>
…uard Signed-off-by: WenyXu <wenymedia@gmail.com>
Signed-off-by: WenyXu <wenymedia@gmail.com>
…ing exit Signed-off-by: WenyXu <wenymedia@gmail.com>
Signed-off-by: WenyXu <wenymedia@gmail.com>
Signed-off-by: WenyXu <wenymedia@gmail.com>
Signed-off-by: WenyXu <wenymedia@gmail.com>
Summary of ChangesHello @WenyXu, 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 significantly refines the handling of region repartitioning within the Mito2 engine. By introducing a dedicated manifest action for partition expression changes and optimizing the staging exit process, it ensures that metadata-only updates are applied efficiently without unnecessary memtable operations. This change enhances the robustness of the staging flow, improves performance for certain metadata alterations, and prevents potential conflicts during region state transitions. Highlights
Changelog
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.
Code Review
This pull request introduces a new PartitionExprChange manifest action to handle partition expression updates without rebuilding memtables. The changes are well-structured and include necessary modifications to manifest handling, version control, and staging flows. The addition of VersionControl::alter_metadata is a key improvement for performance. The new logic is also well-covered by integration tests. I have one suggestion to improve test code maintainability by reducing duplication.
Signed-off-by: WenyXu <wenymedia@gmail.com>
Signed-off-by: WenyXu <wenymedia@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 110b14f916
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: WenyXu <wenymedia@gmail.com>
Signed-off-by: WenyXu <wenymedia@gmail.com>
Signed-off-by: WenyXu <wenymedia@gmail.com>
Signed-off-by: WenyXu <wenymedia@gmail.com>
Signed-off-by: WenyXu <wenymedia@gmail.com>
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
#6558
#7678
What's changed and what's your intention?
This PR refines staging manifest action semantics for repartition flow and ensures staging exit does not rebuild/drop memtables when only partition expression metadata changes.
RegionMetaAction::PartitionExprChangewith payloadRegionPartitionExprChange { partition_expr }.PartitionExprChangeduring manifest replayRegionManifestBuildernow supportsapply_partition_expr_change.RegionManifestManagerreplay paths (recover/install/update) apply this action by updating metadata partition expression only.split_region_change_and_editnow returns partition-expr change + change + edit components.exit_staging_on_success, PartitionExprChange and Change together are treated as invalid and fail fast.PartitionExprChangeinstead of usingRegionChangefor partition-only updates.PartitionExprChange: apply metadata-only update path.change.metadata.column_metadatas == current.column_metadatas; if equal, apply metadata-only update, otherwise fail fast.VersionControl::alter_metadatato update metadata without rebuilding memtables.PartitionExprChangeaction (and notChange);PartitionExprChange+Changeconflict is rejected on staging exit.Change+Editwith same columns succeeds;Change+Editwith different columns fails.PR Checklist
Please convert it to a draft if some of the following conditions are not met.