Re: walsummarizer can get stuck when switching timelines

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: Alexander Lakhin <exclusion(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-10 18:20:29
Message-ID: CA+TgmoYHsXbGeL5hUFq-0hz=3pE3reOxdfr2matWswHDintcqA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 3, 2026 at 5:16 AM Andrey Borodin <x4mmm(at)yandex-team(dot)ru> wrote:
> I think swapping two SQL statements would be enough:
>
> $node2->safe_psql('postgres', <<EOM);
> -SELECT pg_switch_wal();
> CHECKPOINT;
> +SELECT pg_switch_wal();
> EOM

Thanks to both of you for the analysis, and apologies for the slow
response. Here's a patch. I think the tricky part is justifying the
change, which I at least find counterintuitive (else I would have done
it right to begin with!). The attached patch attempts to explain via a
lengthy comment.

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

Attachment Content-Type Size
v1-0001-003_tli_switch.pl-Adjust-command-order-to-avoid-p.patch application/octet-stream 2.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Adam Brusselback 2026-08-10 18:28:47 Re: Avoid calling SetMatViewPopulatedState if possible
Previous Message Daniel Gustafsson 2026-08-10 18:07:00 Re: pg_control_checkpoint(): add "data_checksum_version" (Pg19)?