Skip to content
Permalink
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.
  • Loading branch information
yossigo committed Mar 10, 2020
1 parent b840945 commit da936a95bb8f89ce55708dfd6156f3ca08773a3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
@@ -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 @@ def __init__(self):
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 @@ def remove_member(self):
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))

0 comments on commit da936a9

Please sign in to comment.