raft: improve panic error message

Give a human being some insight into how we might have gotten to this
state based on feedback from #3504.
This commit is contained in:
Brandon Philips 2015-09-12 12:17:02 -07:00 committed by Yicheng Qin
parent 3ceb5dd270
commit 217dccd617

View File

@ -181,7 +181,7 @@ func (l *raftLog) commitTo(tocommit uint64) {
// never decrease commit
if l.committed < tocommit {
if l.lastIndex() < tocommit {
l.logger.Panicf("tocommit(%d) is out of range [lastIndex(%d)]", tocommit, l.lastIndex())
l.logger.Panicf("tocommit(%d) is out of range [lastIndex(%d)]. Was the raft log corrupted, truncated, or lost?", tocommit, l.lastIndex())
}
l.committed = tocommit
}