From 875957f6627c8283d7e4f7d5bb136c4be1f08978 Mon Sep 17 00:00:00 2001 From: jdl Date: Tue, 5 Dec 2023 09:54:41 +0100 Subject: [PATCH] Fixed WAL gc age bug --- lib/rep/replicator-walgc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rep/replicator-walgc.go b/lib/rep/replicator-walgc.go index 2f51da8..5b0bd5c 100644 --- a/lib/rep/replicator-walgc.go +++ b/lib/rep/replicator-walgc.go @@ -15,7 +15,7 @@ func (rep *Replicator) runWALGC() { select { case <-ticker.C: state := rep.getState() - before := time.Now().Unix() - rep.conf.WALSegMaxAgeSec + before := time.Now().Unix() - rep.conf.WALSegGCAgeSec if err := rep.wal.DeleteBefore(before, state.SeqNum); err != nil { log.Printf("[WAL-GC] failed to delete wal segments: %v", err) }