Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

Reject concurrent configuration changes #28

Merged
merged 2 commits into from
Oct 22, 2015
Merged

Conversation

kuujo
Copy link
Member

@kuujo kuujo commented Oct 22, 2015

This PR fixes #26. Both JoinRequests and LeaveRequests received by the leader will be rejected if the leader is already in the process of committing another configuration. The ServerStates join() and leave() methods will retry configuration changes indefinitely if a leader responds with a null error response (not very elegant but works until better server-side exceptions are added).

§4.1

@kuujo
Copy link
Member Author

kuujo commented Oct 22, 2015

Actually, this safety constraint is most essential when the quorum of voting members changes, which is when a member is promoted from PASSIVE to ACTIVE or removed from the cluster. I'll opt to keep the configuring flag in all cases of configuration changes just to be safe, but I don't think it's actually necessary when adding a server to the PASSIVE members list since the quorum does not change.

@kuujo
Copy link
Member Author

kuujo commented Oct 22, 2015

Okay, this PR was updated to include checks to ensure promoting members from PASSIVE to ACTIVE is done safely as well. Essentially, when a configuration change is started, the index of the configuration entry is stored in the LeadsrState. If another configuration change is requested while configuring is non-zero, it will be rejected. Storing the configuration entry index allows that index's CompletaeFuture to be referenced to wait for a configuration change to be completed for promoting members.

kuujo added a commit that referenced this pull request Oct 22, 2015
Reject concurrent configuration changes
@kuujo kuujo merged commit 0c070a4 into master Oct 22, 2015
@kuujo kuujo deleted the single-configuration branch October 22, 2015 19:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reject configuration changes if a configuration change is ongoing
1 participant