Commit da936a95 authored by Yossi Gottlieb's avatar Yossi Gottlieb
Browse files

Fix: multiple REMOVE_NODE permitted.

The limit for enforcing a single uncommitted voting change must apply to
remove node as well. It seems like it was left out considering only the
case where it follows DEMOTE_NODE, but that's not really required.
parent b840945a
......@@ -1179,6 +1179,7 @@ int raft_apply_all(raft_server_t* me_)
int raft_entry_is_voting_cfg_change(raft_entry_t* ety)
{
return RAFT_LOGTYPE_ADD_NODE == ety->type ||
RAFT_LOGTYPE_REMOVE_NODE == ety->type ||
RAFT_LOGTYPE_DEMOTE_NODE == ety->type;
}
......
......@@ -149,7 +149,7 @@ class Snapshot(object):
self.members = []
SnapshotMember = collections.namedtuple('SnapshotMember', ['id', 'voting'], verbose=False)
SnapshotMember = collections.namedtuple('SnapshotMember', ['id', 'voting'])
def raft_send_requestvote(raft, udata, node, msg):
......@@ -575,7 +575,7 @@ class Network(object):
return
# Create a new configuration entry to be processed by the leader
ety = self.add_entry(lib.RAFT_LOGTYPE_DEMOTE_NODE,
ety = self.add_entry(lib.RAFT_LOGTYPE_REMOVE_NODE,
ChangeRaftEntry(server.id))
assert server.connection_status == NODE_CONNECTED
assert(lib.raft_entry_is_cfg_change(ety))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment