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

<fix>: prevent a server joining another cluster whlit it is already in one. #504

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/handle_join_leave.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ ptr<resp_msg> raft_server::handle_join_cluster_req(req_msg& req) {
return resp;
}

ptr<cluster_config> cur_config = get_config();
if (cur_config->get_servers().size() > 1) {
p_in("this server is already in a cluster, ignore the request");
return resp;
}

// MONSTOR-8244:
// Adding server may be called multiple times while previous process is
// in progress. It should gracefully handle the new request and should
Expand Down