From 68d4ec3e13b73b74e7d178289e47f8db3c03ec5e Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Sat, 12 Sep 2015 12:17:02 -0700 Subject: [PATCH] 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. --- raft/log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raft/log.go b/raft/log.go index e171d36ea..b5f0b46c5 100644 --- a/raft/log.go +++ b/raft/log.go @@ -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 }