Skip to content

Commit

Permalink
fix allow leader judge
Browse files Browse the repository at this point in the history
Signed-off-by: Wenbo Zhang <[email protected]>
  • Loading branch information
ethercflow committed Mar 13, 2023
1 parent 5ad0e09 commit 751843e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/schedule/operator/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -935,10 +935,9 @@ func (b *Builder) allowLeader(peer *metapb.Peer, ignoreClusterLimit bool) bool {
// these peer roles are not allowed to become leader.
switch peer.GetRole() {
case metapb.PeerRole_Learner, metapb.PeerRole_DemotingVoter:
return false
}

if peer.IsWitness && !b.isWitnessPromoteToVoter(peer) {
if b.isWitnessPromoteToVoter(peer) {
return true
}
return false
}

Expand Down

0 comments on commit 751843e

Please sign in to comment.