Skip to content

Commit

Permalink
election: reset oldLeaderID after retire from leader (pingcap#529)
Browse files Browse the repository at this point in the history
set oldLeaderInfo = "" after retire from leader
  • Loading branch information
WangXiangUSTC authored Mar 10, 2020
1 parent 263b86b commit d3b0152
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/election/election.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ func (e *Election) campaignLoop(ctx context.Context, session *concurrency.Sessio
e.watchLeader(ctx, session, leaderKey)
e.l.Info("retire from leader", zap.Stringer("current member", e.info))
e.notifyLeader(ctx, nil) // need to re-campaign
oldLeaderID = ""

cancel2()
compaignWg.Wait()
Expand Down

0 comments on commit d3b0152

Please sign in to comment.