Re: pg_upgrade: Test --check with a running source server

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Ewan Young <kdbase(dot)hack(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: pg_upgrade: Test --check with a running source server
Date: 2026-08-31 11:27:07
Message-ID: apVlC6auNuqnuhKD@bdtpg
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Aug 31, 2026 at 06:54:52PM +0800, Ewan Young wrote:
> On Mon, Aug 31, 2026 at 4:19 PM Bertrand Drouvot
> <bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
> > 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.
>
> Thanks for the patches. I had a look at both patches.

Thanks!

> 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/, ...)

The preceding test already proves that live mode is selected by checking that
using the same port error, which is specific to live checks. That said, matching
the banner makes it self contained, so changed it that way in the attached v2.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v2-0001-pg_upgrade-Test-check-with-a-running-source-serve.patch text/x-diff 4.3 KB
v2-0002-Fix-outdated-function-name-in-001_start_stop.pl.patch text/x-diff 1.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Chao Li 2026-08-31 11:26:50 Re: GRAPH_TABLE pattern WHERE clause is not coerced to boolean