Skip to content

Commit

Permalink
Fixing bug in nodeMap update logic
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpert committed Sep 1, 2022
1 parent 6ed4a3b commit 19c60fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ func (r *RaftServer) mutateNodeMap(nodeID uint64, f func(map[uint64]bool)) {
}

f(m)
r.nodeMap[nodeID] = m

if len(m) <= 0 {
delete(r.nodeMap, nodeID)
} else {
r.nodeMap[nodeID] = m
}
}

Expand Down

0 comments on commit 19c60fa

Please sign in to comment.