pgsql: Make 030_pg_recvlogical robust against PID reuse

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Make 030_pg_recvlogical robust against PID reuse
Date: 2026-08-07 03:32:14
Message-ID: E1wsBJe-00000000Wbo-0XW6@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Make 030_pg_recvlogical robust against PID reuse

The reconnection test assumed that a restarted walsender would always
have a different PID from the previous one. On some platforms, however,
PIDs can be reused quickly, causing the test to time out even though
pg_recvlogical has successfully reconnected.

This issue was reported by buildfarm member fairywren:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=fairywren&dt=2026-07-30%2009%3A58%3A12

Fix this by waiting for the server log message indicating that the
logical replication slot has been acquired again, rather than relying on
a PID change.

Backpatch to v19, where the affected reconnection test was introduced by
commit d89b1d817513.

Author: Hayato Kuroda <kuroda(dot)hayato(at)fujitsu(dot)com>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Discussion: https://postgr.es/m/OS9PR01MB121497CF10DFF54F745E37204F5C92@OS9PR01MB12149.jpnprd01.prod.outlook.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/44056f6493ac11ddabbae31098398af71b563904

Modified Files
--------------
src/bin/pg_basebackup/t/030_pg_recvlogical.pl | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2026-08-07 03:32:27 pgsql: Make 030_pg_recvlogical robust against PID reuse
Previous Message Melanie Plageman 2026-08-06 21:33:47 pgsql: Restore vacuum failsafe abandonment of buffer access strategy