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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Israel Barth Rubio <barthisrael@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-06-25T19:51:24Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> 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.

This comment seems to be truncated:

+    /*
+     * If we're the WAL summarizer, we always want to store the values we
+     * just computed into shared memory, because those are the values we're
+     * going to use to drive our operation, and so they are the authoritative
+     * values. Otherwise, we only store values into shared memory if they are
+     */
+    LWLockAcquire(WALSummarizerLock, LW_EXCLUSIVE);
+    if (am_wal_summarizer|| !WalSummarizerCtl->initialized)
+    {

			regards, tom lane



Commits

  1. Prevent summarizer hang when summarize_wal turned off and back on.