Re: Assertion failure in WAL summarizer

From: Daria Lepikhova <daria(dot)n(dot)lepikhova(at)gmail(dot)com>
To: Manu <manuelreyesbravo(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Assertion failure in WAL summarizer
Date: 2026-10-22 08:30:03
Message-ID: CAK49S1A28oFELOo++Vo2Nr_Jh0KQcv5GwUs7dXNLDW7qLiZiXw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I hit the same assertion independently earlier and can confirm Manu's
analysis.

Before promotion, with Fujii's steps on master:

replay 0/03001B08
receive 0/03001D98
summarized 0/03001CB0

which matches the numbers in Manu's mail. The size of the gap between
replay and receive doesn't matter: with ~20MB of streamed WAL past an
arbitrary recovery_target_lsn (recovery_target_inclusive = true) the
summarizer is ~20MB ahead and the crash is the same.

With cassert disabled, I don't see any adverse effects either: summaries
on TLI 2 start at the switch point, and an incremental backup across the
promotion works.

With v1 applied on master, the same scenarios pass with cassert and the
new test passes; with the walsummarizer.c hunk reverted, the test fails
with the TRAP. pg_walsummary and pg_combinebackup TAP suites pass.

A couple of minor comments on v1:

1. The comment in summarizer_read_local_xlog_page() about read_upto
moving backwards says the next iteration will "likely conclude that
we've reached end of WAL". It might be worth mentioning there that
SummarizeWAL() then reports no progress, so the link between the two
places is visible from both sides.

2. In the test, the summarizer PID check and the log check both detect
the same thing, a restart after the crash. Without the fix neither
is reached anyway: pg_ctl promote fails once the postmaster
reinitializes, and the test dies without a plan. I think one of the
two checks would be sufficient.

Separately, while looking at this I found a related but different
problem: if the switch point falls exactly on a page or segment
boundary, the first summary on the new timeline starts after the page
header, and incremental backups on top of any pre-promotion backup fail
permanently with "WAL summaries are required on timeline 2 from
0/04000000 ...". v1 doesn't change that, and it isn't expected to. I'll
look into it
more closely and then maybe start a separate thread with a reproducer.

--
Daria Lepikhova

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2026-10-22 08:40:37 Re: Publication of same parent table with ONLY-ness mismatch should error
Previous Message Chao Li 2026-10-22 08:19:01 Re: [PATCH v1] Fix for bug #19770 : Reject NO INHERIT not-null constraints copied by LIKE to partitioned tables