pg_upgrade: Test --check with a running source server

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Michael Paquier <michael(at)paquier(dot)xyz>
Subject: pg_upgrade: Test --check with a running source server
Date: 2026-08-31 08:19:10
Message-ID: apU4/hmRv/4gv20W@bdtpg
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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].

[0]: https://postgr.es/m/apUL3N4IE934qJ08%40bdtpg

Regards,

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

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-08-31 08:38:12 Re: GRAPH_TABLE pattern WHERE clause is not coerced to boolean
Previous Message Andrey Borodin 2026-08-31 08:07:18 Re: SSI: A patch for a Serializability violation