pgsql: Fix logical replication TAP test to read publisher log correctly

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix logical replication TAP test to read publisher log correctly
Date: 2026-02-04 15:48:03
Message-ID: E1vnf6o-0017v9-2K@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix logical replication TAP test to read publisher log correctly.

Commit 5f13999aa11 added a TAP test for GUC settings passed via the
CONNECTION string in logical replication, but the buildfarm member
sungazer reported test failures.

The test incorrectly used the subscriber's log file position as the
starting offset when reading the publisher's log. As a result, the test
failed to find the expected log message in the publisher's log and
erroneously reported a failure.

This commit fixes the test to use the publisher's own log file position
when reading the publisher's log.

Also, to avoid similar confusion in the future, this commit splits the single
$log_location variable into $log_location_pub and $log_location_sub,
clearly distinguishing publisher and subscriber log positions.

Backpatched to v15, where commit 5f13999aa11 introduced the test.

Per buildfarm member sungazer.
This issue was reported and diagnosed by Alexander Lakhin.

Reported-by: Alexander Lakhin <exclusion(at)gmail(dot)com>
Discussion: https://postgr.es/m/966ec3d8-1b6f-4f57-ae59-fc7d55bc9a5a@gmail.com
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/36ead7123292c2849be9950f3e552325fad7e6b7

Modified Files
--------------
src/test/subscription/t/001_rep_changes.pl | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2026-02-04 15:48:37 pgsql: Fix logical replication TAP test to read publisher log correctly
Previous Message John Naylor 2026-02-04 11:11:23 pgsql: Fix various instances of undefined behavior