Re: walsummarizer can get stuck when switching timelines - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: walsummarizer can get stuck when switching timelines
Date
Msg-id B58164E1-190A-4C9E-9509-1B0A8BED72EC@yandex-team.ru
Whole thread
In response to Re: walsummarizer can get stuck when switching timelines  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: walsummarizer can get stuck when switching timelines
List pgsql-hackers

> On 16 Jul 2026, at 01:18, Robert Haas <robertmhaas@gmail.com> wrote:
>
>
> understand Andrey's probable desire to have me review his patch on
> that thread, but I think whatever is going on there is only
> tangentially related to this problem.

Of course I'd like that fix committed too :) But that's not why I'm raising it here.

+# The reason for the problem is that when a new primary is promoted, the
+# partial file that ends the old timeline is renamed, giving it a ".partial"
+# suffix, and is not archived. That's not a problem for recovery, because
+# the bytes that appear at the start of that segment will be copied into the
+# first segment on the new timeline, and recovery will read them from there
+# and work just fine.

That only holds when the new timeline's segment is already available. If it isn't,
XLogFileReadAnyTLI() falls back to the ancestor's segment and, past the switch point,
hands recovery the old timeline's divergent WAL. It's the mirror, on the recovery
side, of what your patch fixes for the summarizer.

I'm not asking you to fix XLogFileReadAnyTLI() here. I just don't think the new
comment should claim recovery is unaffected.


Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: Siddharth Kothari
Date:
Subject: Re: [PATCH] Add RetrieveInstrumentation hook for CustomScan providers
Next
From: Ajin Cherian
Date:
Subject: Re: [PATCH] Preserve replication origin OIDs in pg_upgrade