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

[v23.1.x] r/group_manager: protect against race with set_ready() #16085

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/v/raft/group_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ ss::future<ss::lw_shared_ptr<raft::consensus>> group_manager::create_group(

return ss::with_gate(_gate, [this, raft] {
return _heartbeats.register_group(raft).then([this, raft] {
if (_is_ready) {
// Check _is_ready flag again to guard against the case when
// set_ready() was called after we created this consensus
// instance but before we insert it into the _groups
// collection.
raft->reset_node_priority();
}
_groups.push_back(raft);
return raft;
});
Expand Down