Re: 035_standby_logical_decoding might fail due to FATAL message lost inside libpq

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Alexander Lakhin <exclusion(at)gmail(dot)com>
Subject: Re: 035_standby_logical_decoding might fail due to FATAL message lost inside libpq
Date: 2026-10-20 15:08:56
Message-ID: CAHGQGwEnuLZnFRF5CzK47n_hXT-iCXnzirxG2v_V-=QNMLkpEA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 2, 2026 at 2:42 PM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
> That's great. I changed the status to "Ready for Committer".

I've started reviewing this patch since it's marked as ready for committer.
I have two review comments.

+ my $pump_timeout =
+ IPC::Run::timer($PostgreSQL::Test::Utils::timeout_default);

This timer is never started or passed to IPC::Run::start(), so it seems
it can never expire. Right? If so, isn't it better to reuse the existing
timeout for pump_until()?

+ ok(pump_until($slot_user_handle, $pump_timeout, $to_stderr,
+ qr/streaming initiated/),
+ "pg_recvlogical started streaming");

This allows the test to continue even if pump_until() returns false.
Since streaming is a prerequisite for the subsequent steps, we should
use or die(), as the old code did?

Attached 0001 addresses these comments.

I also found a pre-existing typo: the slots are created with the prefix
"drop_db_", but their removal is checked using "drop_db". Since
those names never existed, the checks pass even if the actual slots
remain. Attached 0002 fixes this.

Regards,

--
Fujii Masao

Attachment Content-Type Size
v2-0002-Fix-slot-names-in-the-standby-slot-removal-check.patch application/octet-stream 1.3 KB
v2-0001-Fix-a-race-in-035_standby_logical_decoding.pl.patch application/octet-stream 3.4 KB
nocfbot-v2-0001-PG16_PG17-Fix-a-race-in-035_standby_logical_decoding.pl.patch application/octet-stream 3.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nitin Jadhav 2026-10-20 15:19:51 Re: Disable startup progress timeout during standby WAL replay
Previous Message Matheus Alcantara 2026-10-20 15:05:01 Wrong result for whole-row IS NOT NULL with dropped columns