Skip to content

Commit

Permalink
avoid panic after member is removed
Browse files Browse the repository at this point in the history
  • Loading branch information
galal-hussein authored and brandond committed Jan 6, 2022
1 parent c8502f7 commit 643f36c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/etcdserver/api/membership/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,12 @@ func (c *RaftCluster) IsLocalMemberLearner() bool {
defer c.Unlock()
localMember, ok := c.members[c.localID]
if !ok {
c.lg.Panic(
c.lg.Error(
"failed to find local ID in cluster members",
zap.String("cluster-id", c.cid.String()),
zap.String("local-member-id", c.localID.String()),
)
return false
}
return localMember.IsLearner
}
Expand Down

0 comments on commit 643f36c

Please sign in to comment.