Subject: Re: Apparent bug in WAL summarizer process (hung state)

From: Robert Haas <[email-masked]>
Date: Tue, 25 Jun 2024 15:48:07 -0400

On Mon, Jun 24, 2024 at 1:56 PM Israel Barth Rubio
<[email-masked]> wrote:
> I've been playing a bit with the incremental backup feature which might come as
> part of the 17 release, and I think I hit a possible bug in the WAL summarizer
> process.
>
> The issue that I face refers to the summarizer process getting into a hung state.
> When the issue is triggered, it keeps in an infinite loop trying to process a WAL
> file that no longer exists.  It apparently comes up only when I perform changes to
> `wal_summarize` GUC and reload Postgres, while there is some load in Postgres
> which makes it recycle WAL files.

Yeah, this is a bug. It seems that the WAL summarizer process, when
restarted, wants to restart from wherever it was previously
summarizing WAL, which is correct if that WAL is still around, but if
summarize_wal has been turned off in the meanwhile, it might not be
correct. Here's a patch to fix that.

-- 
Robert Haas
EDB: http://www.enterprisedb.com