Under rare scenarios we could fail to load, but this should not be a panic.

We should recover on the lines below.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2021-03-29 07:34:28 -07:00
parent c8d812d805
commit 327d913ae1

View File

@@ -413,7 +413,8 @@ func (s *Server) startRaftNode(cfg *RaftConfig) (RaftNode, error) {
for index := state.FirstSeq; index <= state.LastSeq; index++ {
ae, err := n.loadEntry(index)
if err != nil {
panic("err loading entry from WAL")
n.warn("Could not load %d from WAL [%+v] with error: %v", index, state, err)
continue
}
if ae.pindex != index-1 {
n.warn("Corrupt WAL, truncating and fixing")