On Mon, Aug 31, 2026 at 4:19 PM Bertrand Drouvot
<[email protected]> wrote:
>
> Hi hackers,
>
> While doing some tests for [0], I noticed that we don't have coverage for
> pg_upgrade --check with a running source server.
>
> Indeed, commit 4fff78f009 added TAP coverage for pg_upgrade --check, but only
> after stopping the source server.
>
> 0001 attached adds coverage with the source still running. This covers live
> server
> detection, connection details from postmaster.pid, control data from
> pg_controldata,
> reuse of the running postmaster, and the requirement for different source and
> target
> ports.
>
> It also tests that logical slots with unconsumed WAL are accepted during a
> live
> check. The existing offline check verifies that the same slots are rejected
> after
> shutdown.
>
> Remarks:
>
> 1/ my CI was failing on Windows (at the new 003_logical_slots.pl test) for the
> same reason why a sleep is part of 001_start_stop.pl. So adding the same
> comment
> and sleep in 003_logical_slots.pl too.
>
> 2/ while at 1/ I observed the comment in 001_start_stop.pl was using a stale
> function name. 0002 fixes it.
>
> 3/ the proposed tests would have had catch === 2 mentioned in [0].
Thanks for the patches. I had a look at both patches.
One optional thought on the success case in 002: command_like()
matching the live-mode banner would be a bit more precise than
command_ok(), since exit code 0 alone can't tell a live check from an
offline one (against a stopped old server, pg_upgrade would start it
itself and succeed just the same):
command_like(..., qr/Performing Consistency Checks on Old Live Server/, ...)
0002 looks good: a745b936507 did rename wait_for_postmaster() to
wait_for_postmaster_start(), and it shows the line you're fixing
is the only stale reference left in the tree.
>
> [0]: https://postgr.es/m/apUL3N4IE934qJ08%40bdtpg
>
> Regards,
>
> --
> Bertrand Drouvot
> PostgreSQL Contributors Team
> RDS Open Source Databases
> Amazon Web Services: https://aws.amazon.com
--
Regards,
Ewan Young