-
Notifications
You must be signed in to change notification settings - Fork 456
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): support migrate slot range #2389
Conversation
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.
@PokIsemaine Thanks for your impressive contributions. I will take another pass while it's ready to be reviewed.
If it's convenient, I would like to discuss some matters related to the TODO list: First, regarding item 2 on the TODO list, I find this situation a bit confusing because I am not sure if this is the intended design of kvrocks. If possible, please determine whether this is a normal situation. Second, concerning items 1 and 3 on the TODO list, these are enhancements. Please evaluate whether these features are needed and if they should be included in this PR. |
This is indeed the case at the moment. The migrated slots is not checked when the migration is performed, and I think they should be checked.
I think these are good improvements, but we can add them in the subsequent PR. This PR is enough. |
@caipengbo Ok, thanks for the suggestion. So for the second TODO, do we try to fix it at this PR or create another separate issue to track it? |
Let's fix it in this PR. @PokIsemaine |
@PokIsemaine I think this PR is ready to review now? |
You can start the review now :) The |
Could you fix these clang-tidy issues? Please make sure the code can be successfully compiled.
|
Thank you! I will take another pass in one or two days. |
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.
This PR generally looks good to me, left two comments. To see if other maintainers have further comments.
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.
+1 for we with some nits
Will merge this PR if no further comments and CI is passed. |
Quality Gate passedIssues Measures |
Nice work, thanks! |
issues: #2355
This draft PR demonstrates how to support migrating slot ranges.
What I Did
1 Migration job - 1 slot range:
SlotRange
structure and changed the migration-related class members from a single slot to a slot range.TODO
TODO represents the items I hope to discuss.
Support multiple slot ranges:
Perform multiple migrations consecutively but do not immediately use
setslot
to update the topology, referring to the example in TestSlotRangeMigrate:This situation also seems to exist in the original single slot migration, and I am not sure if such operations are reasonable.
The current implementation determines the entire slot range to fail and cleans it up, and the user later migrates the entire slot range again.
Do we want to support a more precise failure range? For example,
[start_slot-fail_slot), [fail_slot, end]
. Users can check the status with commands such ascluster info
and then re-migrate the failed slot range by themselves. (Personally, I think it's a bit cumbersome and error-prone)Miscellaneous
Other suggestions are welcome, such as more testing, code optimization, better user interaction, etc.