Skip to content

Commit 83f6e59

Browse files
[IMPROVED] NRG: Clarify log when resetting WAL
Signed-off-by: Maurice van Veen <[email protected]>
1 parent f35e073 commit 83f6e59

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/raft.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3259,7 +3259,11 @@ func (n *raft) truncateWAL(term, index uint64) {
32593259
n.debug("Truncating and repairing WAL to Term %d Index %d", term, index)
32603260

32613261
if term == 0 && index == 0 {
3262-
n.warn("Resetting WAL state")
3262+
if n.commit > 0 {
3263+
n.warn("Resetting WAL state")
3264+
} else {
3265+
n.debug("Clearing WAL state (no commits)")
3266+
}
32633267
}
32643268

32653269
defer func() {

0 commit comments

Comments
 (0)