-
Notifications
You must be signed in to change notification settings - Fork 876
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): #2448 add new DFLYMIGRATE ACK cmd #2582
Conversation
035362b
to
33f78da
Compare
|
||
// TODO it's a bug need to rewrite with mutex or fix tl_cluster_config because it's not thread | ||
// local | ||
cluster_family_->cluster_config()->AddSlots(added_slots); |
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.
I think you should add the slots only if you receive OK on DFLYMIGRATE ACK
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.
Add slots is not a problem even if don't get OK, because it's an error processing situation. But if we add slots only after ok we can lose requests from the clients because the source node removes slots but the target node doesn't add them so nobody can process requests
@@ -142,8 +142,7 @@ void ClusterSlotMigration::MainMigrationFb() { | |||
<< ec.message(); | |||
} | |||
|
|||
bool success = true; | |||
if (success = IsFinalized(); success) { | |||
if (IsFinalized()) { | |||
state_ = MigrationState::C_FINISHED; |
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.
update state after you get ok?
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.
I think it's the correct place to set a new status, ACK cmd and OK doesn't affect slot migration process, and more like error processing
src/server/cluster/cluster_config.cc
Outdated
@@ -298,6 +298,18 @@ shared_ptr<ClusterConfig> ClusterConfig::CreateFromConfig(string_view my_id, | |||
return CreateFromConfig(my_id, config.value()); | |||
} | |||
|
|||
std::shared_ptr<ClusterConfig> ClusterConfig::CloneAndUpdate(const std::vector<SlotRange>& slots, |
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.
we need to update ClusterShards config_; here as well otherwise we will not reply with the relevant moved error
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.
yes I know, but if we use the new approach that we discuss we don;t need these changes
ACK cmd is the answer from a target node to a source node' FINALIZE cmd