]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Prevent walsummarizer from getting stuck at a timeline switch.
authorRobert Haas <rhaas@postgresql.org>
Fri, 31 Jul 2026 15:55:54 +0000 (11:55 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 31 Jul 2026 15:55:54 +0000 (11:55 -0400)
commit3e8a0c1b02c3d8b96cd5febacab8aaba4869431f
tree81ce2ea4af9eb19959743bdeebb636b4f22da9b1
parentbaab3268cc275277ee923c0d2fcaf62a61707eea
Prevent walsummarizer from getting stuck at a timeline switch.

As previously coded, walsummarizer only wants to read WAL from a file
where the TimeLineID in the filename exactly matches the TimeLineID being
summarized. But in some cases, when a timeline switch occurs, the WAL file
from the old timeline is not archived, because it's never completely
filled, so the only way to obtain the contents of that last partial
segment is to read from the first segment on the new timeline. Teach
WAL summarizer to do that, and add a test case to make sure that it
works.

Reported-by: Nick Ivanov <nick.ivanov@enterprisedb.com>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Tested-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Srinath Reddy Sadipiralla <srinath2133@gmail.com>
Reviewed-by: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Thom Brown <thom@linux.com>
Discussion: http://postgr.es/m/CA+Tgmobr27GpKDZx3_ezW2+C5_g18i+jSK3sGF_cR-_ESv5N5A@mail.gmail.com
Backpatch-through: 17
src/backend/postmaster/walsummarizer.c
src/bin/pg_walsummary/meson.build
src/bin/pg_walsummary/t/003_tli_switch.pl [new file with mode: 0644]