Re: [Patch]The Case For WAL-Logging pg_upgrade

From: John Naylor <johncnaylorls(at)gmail(dot)com>
To: Bohyun Lee <bohyun(dot)lee(at)databricks(dot)com>
Cc: Marco Nenciarini <marco(dot)nenciarini(at)enterprisedb(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, hlinnaka(at)iki(dot)fi
Subject: Re: [Patch]The Case For WAL-Logging pg_upgrade
Date: 2026-10-03 05:23:07
Message-ID: CANWCAZbxexVpX4F9RWpzK=hQTQTo+01D+FaY2KMjwxf7dg-_aw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 2, 2026 at 12:27 AM Bohyun Lee <bohyun(dot)lee(at)databricks(dot)com> wrote:

> 2. Handoff atomicity and shutdown ordering
>
> Feedback: the old primary might continue processing transactions after the
> handoff. The handoff command should shut down the primary at the handoff record.
> The handoff could also be represented by the shutdown checkpoint itself.

Marking the shutdown checkpoint is precisely the approach I've taken
in my own work, so I've attached two small patches to show this. They
were extracted from a larger series that's not quite ready to share,
so some details may need to change. There are a couple forward-looking
bits that are out of context, but it's mostly independent of the rest.

I didn't share earlier because I didn't think it was quite compatible
with your proposal, but since you mentioned it, I'm now curious how
close it is to being compatible.

It's worth calling out the fact that the old binary must be aware of
the "handoff" (my series calls it a "version boundary" or "upgrade
boundary", but it seems to be the same concept). In my view, whatever
the old binary needs is as much as we can commit for PG20, and
anything in the target version should probably not be committed until
PG21 at the earliest. They have to be developed together, so timing is
a bit tricky, but using the shutdown checkpoint seems to me the least
invasive way to be forward-looking. Your first patch (I haven't looked
at the second) didn't distinguish the needs of the old and new
binaries cleanly since it was a single patch. (BTW, 0002
conventionally means the second patch in a series, applied on top of
0001 in order. You can make git add patch numbers and version numbers
with `git format-patch master -v 2`)

--
John Naylor
Amazon Web Services

Attachment Content-Type Size
nocfbot-v20261003-0001-Allow-marking-a-shutdown-checkpoint-as-an-.patch text/x-patch 23.4 KB
nocfbot-v20261003-0002-Pause-archive-recovery-at-an-upgrade-bound.patch text/x-patch 30.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-10-03 05:27:34 Re: Speed up lpad() and rpad() for one-byte padding strings
Previous Message shihao zhong 2026-10-03 04:47:03 Re: Report relation extension blockers within parallel lock groups