From 065583cf460f980a182498941ac52810f709a897 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 25 Jun 2024 15:42:36 -0400 Subject: Prevent summarizer hang when summarize_wal turned off and back on. Before this commit, when the WAL summarizer started up or recovered from an error, it would resume summarization from wherever it left off. That was OK normally, but wrong if summarize_wal=off had been turned off temporary, allowing some WAL to be removed, and then turned back on again. In such cases, the WAL summarizer would simply hang forever. This commit changes the reinitialization sequence for WAL summarizer to rederive the starting position in the way we were already doing at initial startup, fixing the problem. Per report from Israel Barth Rubio. Reviewed by Tom Lane. Discussion: http://postgr.es/m/CA+TgmoYN6x=YS+FoFOS6=nr6=qkXZFWhdiL7k0oatGwug2hcuA@mail.gmail.com --- src/backend/access/transam/xlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/access/transam/xlog.c') diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index a69337f2d4b..d36272ab4ff 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7916,7 +7916,7 @@ KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo) * If WAL summarization is in use, don't remove WAL that has yet to be * summarized. */ - keep = GetOldestUnsummarizedLSN(NULL, NULL, false); + keep = GetOldestUnsummarizedLSN(NULL, NULL); if (keep != InvalidXLogRecPtr) { XLogSegNo unsummarized_segno; -- cgit v1.2.3