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

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Fujii Masao' <masao(dot)fujii(at)gmail(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-21 06:37:10
Message-ID: OS7PR01MB183172006A01B2FE0FAA0BC1DF5662@OS7PR01MB18317.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Fujii-san,

> I've started reviewing this patch since it's marked as ready for committer.

Thanks!

> + 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()?

I referred the existing code in the same file, like [1].
But you seem right - perl doc [2] describes start() can register a timer object
to the harness and starts it, pump() checks the result. pump() internally calls
start() but calling it alone is not enough because timer must be registered.

It meant existing codes might also be fixed, right?

> + 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?

+1.

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

Good catch, LGTM.

[1]
```
# check that we are decoding pre and post promotion inserted rows
# with pg_recvlogical that has started before the promotion
my $pump_timeout = IPC::Run::timer($PostgreSQL::Test::Utils::timeout_default);

ok(pump_until($handle, $pump_timeout, \$stdout, qr/^.*COMMIT.*COMMIT$/s),
'got 2 COMMIT from pg_recvlogical output');
```
[2]: https://metacpan.org/pod/IPC::Run

Best regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Keyerror Smart 2026-10-21 06:43:04 Re: [PATCH]Fix planner's strictness check for JsonExpr
Previous Message solai v 2026-10-21 06:32:16 Re: [PATCH] Add CANONICAL option to xmlserialize