commit
c7e4198742
|
@ -574,9 +574,9 @@ func (r *raft) poll(id uint64, v bool) (granted int) {
|
||||||
func (r *raft) Step(m pb.Message) error {
|
func (r *raft) Step(m pb.Message) error {
|
||||||
if m.Type == pb.MsgHup {
|
if m.Type == pb.MsgHup {
|
||||||
if r.state != StateLeader {
|
if r.state != StateLeader {
|
||||||
ents, err := r.raftLog.entries(r.raftLog.applied+1, r.raftLog.committed-r.raftLog.applied)
|
ents, err := r.raftLog.slice(r.raftLog.applied+1, r.raftLog.committed+1, noLimit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.Panicf("unexpected error getting uncommitted entries (%v)", err)
|
r.logger.Panicf("unexpected error getting unapplied entries (%v)", err)
|
||||||
}
|
}
|
||||||
if n := numOfPendingConf(ents); n != 0 && r.raftLog.committed > r.raftLog.applied {
|
if n := numOfPendingConf(ents); n != 0 && r.raftLog.committed > r.raftLog.applied {
|
||||||
r.logger.Warningf("%x cannot campaign at term %d since there are still %d pending configuration changes to apply", r.id, r.Term, n)
|
r.logger.Warningf("%x cannot campaign at term %d since there are still %d pending configuration changes to apply", r.id, r.Term, n)
|
||||||
|
|
Loading…
Reference in New Issue