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): add migration finalization #2507

Merged
merged 6 commits into from
Feb 1, 2024

Conversation

BorysTheDev
Copy link
Contributor

No description provided.

@BorysTheDev BorysTheDev force-pushed the add_migration_finalization branch from 9693a3e to f91a123 Compare January 31, 2024 17:14
@BorysTheDev BorysTheDev requested a review from adiholden February 1, 2024 11:03
Comment on lines 716 to 727
shard_set->pool()->AwaitFiberOnAll([migration_it](auto*) {
if (const auto* shard = EngineShard::tlocal(); shard)
migration_it->second->Finalize(shard->shard_id());
});

// TODO do next after ACK
util::ThisFiber::SleepFor(500ms);

shard_set->pool()->AwaitFiberOnAll([migration_it](auto*) {
if (const auto* shard = EngineShard::tlocal(); shard)
migration_it->second->Cancel(shard->shard_id());
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
shard_set->pool()->AwaitFiberOnAll([migration_it](auto*) {
if (const auto* shard = EngineShard::tlocal(); shard)
migration_it->second->Finalize(shard->shard_id());
});
// TODO do next after ACK
util::ThisFiber::SleepFor(500ms);
shard_set->pool()->AwaitFiberOnAll([migration_it](auto*) {
if (const auto* shard = EngineShard::tlocal(); shard)
migration_it->second->Cancel(shard->shard_id());
});
shard_set->pool()->AwaitFiberOnAll([migration_it](auto*) {
if (const auto* shard = EngineShard::tlocal(); shard)
migration_it->second->Finalize(shard->shard_id());
// TODO do next after ACK
util::ThisFiber::SleepFor(500ms);
migration_it->second->Cancel(shard->shard_id());
});

I imagine we will also wait for the ACK in each of the shards, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no we will have only one ack and I think they will be here or in OutgoingMigration::Finalize

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// TODO do next after ACK
util::ThisFiber::SleepFor(500ms);

also TODO: actually stop traffic to make transition atomic 🙂

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 already in progress with that) so I will not forget about it

src/server/cluster/cluster_shard_migration.cc Outdated Show resolved Hide resolved
src/server/cluster/cluster_slot_migration.h Show resolved Hide resolved
@BorysTheDev BorysTheDev force-pushed the add_migration_finalization branch from 8318973 to 82c48f6 Compare February 1, 2024 12:46
chakaz
chakaz previously approved these changes Feb 1, 2024
@BorysTheDev BorysTheDev requested a review from adiholden February 1, 2024 13:02
src/server/cluster/cluster_family.cc Outdated Show resolved Hide resolved
Comment on lines 716 to 727
shard_set->pool()->AwaitFiberOnAll([migration_it](auto*) {
if (const auto* shard = EngineShard::tlocal(); shard)
migration_it->second->Finalize(shard->shard_id());
});

// TODO do next after ACK
util::ThisFiber::SleepFor(500ms);

shard_set->pool()->AwaitFiberOnAll([migration_it](auto*) {
if (const auto* shard = EngineShard::tlocal(); shard)
migration_it->second->Cancel(shard->shard_id());
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// TODO do next after ACK
util::ThisFiber::SleepFor(500ms);

also TODO: actually stop traffic to make transition atomic 🙂

@BorysTheDev BorysTheDev merged commit 5189dae into main Feb 1, 2024
10 checks passed
@BorysTheDev BorysTheDev deleted the add_migration_finalization branch February 1, 2024 15:24
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.

5 participants