You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (l*raftLog) findConflictByTerm(indexuint64, termuint64) (uint64, uint64) {
for ; index>0; index-- {
// If there is an error (likely ErrCompacted or ErrUnavailable), we don't// know whether it's a match or not, so assume a possible match and return// the index, with 0 term indicating an unknown term.ifourTerm, err:=l.term(index); err!=nil {
returnindex, 0
} elseifourTerm<=term {
returnindex, ourTerm
}
}
return0, 0
}
But when PreVote and checkQuorum is enable, one electionTimeout's log may be the stale log When partition happened.This is common.And When network recover, the follower will search many logs. And When PreVote and CheckQuorum is enable, there is only one term logs will be stale in the most cases. So I think there is a need to add preTermLastLog to accelerate this.For example:
func (l*raftLog) findConflictByTerm(indexuint64, termuint64) (uint64, uint64) {
ifl.preTermLastIndex>0 {
returnl.preTermLastIndex, l.preTerm
}
for ; index>0; index-- {
// If there is an error (likely ErrCompacted or ErrUnavailable), we don't// know whether it's a match or not, so assume a possible match and return// the index, with 0 term indicating an unknown term.ifourTerm, err:=l.term(index); err!=nil {
returnindex, 0
} elseifourTerm<=term {
returnindex, ourTerm
}
}
return0, 0
}
The text was updated successfully, but these errors were encountered:
Now etcd raft find hintindex slowly
But when PreVote and checkQuorum is enable, one electionTimeout's log may be the stale log When partition happened.This is common.And When network recover, the follower will search many logs. And When PreVote and CheckQuorum is enable, there is only one term logs will be stale in the most cases. So I think there is a need to add preTermLastLog to accelerate this.For example:
The text was updated successfully, but these errors were encountered: