From f28d35dce64518e65604abc2233bf6c7331b6700 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Thu, 21 Nov 2024 17:42:18 -0800 Subject: [PATCH] first error where the issue should be detected --- events/diskpersist.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/events/diskpersist.go b/events/diskpersist.go index 25eb989af..dd63b2e2d 100644 --- a/events/diskpersist.go +++ b/events/diskpersist.go @@ -173,6 +173,10 @@ func (dp *DiskPersistence) resumeLog() error { return fmt.Errorf("failed to scan log file for last seqno: %w", err) } + if seq < lfr.SeqStart { + return fmt.Errorf("somehow the final sequence in the log is in the wrong range %d < %d", seq, lfr.SeqStart) + } + dp.curSeq = seq dp.logfi = fi