Skip to content

Commit

Permalink
<fix>: prevent a server joining another cluster whlit it is already i…
Browse files Browse the repository at this point in the history
…n one. (#504)

Co-authored-by: fwhdzh <fengwenhan21@otcaix.iscas.ac.cn>
  • Loading branch information
fwhdzh and fwhdzh committed May 6, 2024
1 parent 17cdd1f commit 83a847b
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 83a847b

Please sign in to comment.