Skip to content

Commit

Permalink
Merge pull request etcd-io#1 from galal-hussein/v3.14.3-rancher1
Browse files Browse the repository at this point in the history
Add ConfChangeAddLearnerNode to the list of config changes
  • Loading branch information
galal-hussein authored Sep 11, 2020
2 parents dd1b699 + b42ed00 commit 158b371
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions etcdserver/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ func restartAsStandaloneNode(cfg ServerConfig, snapshot *raftpb.Snapshot) (types
// ID-related entry:
// - ConfChangeAddNode, in which case the contained ID will be added into the set.
// - ConfChangeRemoveNode, in which case the contained ID will be removed from the set.
// - ConfChangeAddLearnerNode, in which the contained ID will be added into the set.
func getIDs(lg *zap.Logger, snap *raftpb.Snapshot, ents []raftpb.Entry) []uint64 {
ids := make(map[uint64]bool)
if snap != nil {
Expand All @@ -693,6 +694,8 @@ func getIDs(lg *zap.Logger, snap *raftpb.Snapshot, ents []raftpb.Entry) []uint64
var cc raftpb.ConfChange
pbutil.MustUnmarshal(&cc, e.Data)
switch cc.Type {
case raftpb.ConfChangeAddLearnerNode:
ids[cc.NodeID] = true
case raftpb.ConfChangeAddNode:
ids[cc.NodeID] = true
case raftpb.ConfChangeRemoveNode:
Expand Down

0 comments on commit 158b371

Please sign in to comment.