-
Notifications
You must be signed in to change notification settings - Fork 981
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
Conversation
9693a3e
to
f91a123
Compare
src/server/cluster/cluster_family.cc
Outdated
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()); | ||
}); |
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.
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?
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.
no we will have only one ack and I think they will be here or in OutgoingMigration::Finalize
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.
// TODO do next after ACK
util::ThisFiber::SleepFor(500ms);
also TODO: actually stop traffic to make transition atomic 🙂
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 already in progress with that) so I will not forget about it
8318973
to
82c48f6
Compare
src/server/cluster/cluster_family.cc
Outdated
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()); | ||
}); |
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.
// TODO do next after ACK
util::ThisFiber::SleepFor(500ms);
also TODO: actually stop traffic to make transition atomic 🙂
No description provided.