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): #2448 add new DFLYMIGRATE ACK cmd #2582

Merged
merged 4 commits into from
Feb 19, 2024

Conversation

BorysTheDev
Copy link
Contributor

ACK cmd is the answer from a target node to a source node' FINALIZE cmd


// 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);
Copy link
Collaborator

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

Copy link
Contributor Author

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;
Copy link
Collaborator

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?

Copy link
Contributor Author

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

@@ -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,
Copy link
Collaborator

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

Copy link
Contributor Author

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

@BorysTheDev BorysTheDev merged commit 491538e into main Feb 19, 2024
10 checks passed
@BorysTheDev BorysTheDev deleted the add_DFLYMIGRATE_ACK_cmd branch February 19, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants