Procházet zdrojové kódy

Merge pull request #3506 from philips/improve-tocommit-error

raft: improve panic error message
Xiang Li před 10 roky
rodič
revize
cdaa263346
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      raft/log.go

+ 1 - 1
raft/log.go

@@ -181,7 +181,7 @@ func (l *raftLog) commitTo(tocommit uint64) {
 	// never decrease commit
 	// never decrease commit
 	if l.committed < tocommit {
 	if l.committed < tocommit {
 		if l.lastIndex() < 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
 		l.committed = tocommit
 	}
 	}