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

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

On Mon, Aug 31, 2026 at 11:27:07AM +0000, Bertrand Drouvot wrote:
> On Mon, Aug 31, 2026 at 06:54:52PM +0800, Ewan Young wrote:
>> 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.

These two new tests for a live server, one failure where the new port
and old ports do not match, and one failure where we are checking the
old server with a correct new port, look like acceptable additions
here. Will test a bit more, and apply on HEAD, I guess.

+# by wait_for_postmaster_start() prevents that mistake.
+sleep 3 if ($windows_os);

In 003_logical_slots, I am not convinced that this is going to be
entirely stable all the time.. Hardcoded sleeps never finish well,
even if these are platform-dependent.

Picked up v2-0002 on a different branch where I am stacking all these
mistakes for a group commit.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nisha Moond 2026-09-03 06:05:36 Re: Fix resource leak in FindConflictTuple() retry path
Previous Message Bertrand Drouvot 2026-09-03 05:50:34 Re: pgstat: Flush some statistics within running transactions, take 2