Re: walsummarizer can get stuck when switching timelines

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: walsummarizer can get stuck when switching timelines
Date: 2026-08-03 09:16:33
Message-ID: ABE387F1-27B4-41E0-9608-D5F6B0C290FE@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 2 Aug 2026, at 21:00, Alexander Lakhin <exclusion(at)gmail(dot)com> wrote:
>
> So it looks like the test might fail when the checkpoint record slips into
> segment 4.

I think swapping two SQL statements would be enough:

$node2->safe_psql('postgres', <<EOM);
-SELECT pg_switch_wal();
CHECKPOINT;
+SELECT pg_switch_wal();
EOM

The CHECKPOINT is what gives the summarizer a redo point to close the
timeline-2 summary at, and node3 only ever reads completed segments from
the archive, so it has to be before pg_switch_wal().

CI shows no problems with this change to me.

Best regards, Andrey Borodin.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2026-08-03 09:23:47 Re: Bug: XLogReader mishandles oversized multi-page xl_tot_len (potential memory corruption)
Previous Message Michael Paquier 2026-08-03 09:12:55 Re: Add pg_stat_kind_info system view