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

Поиск
Список
Период
Сортировка
Искать

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

От:
Alexander Lakhin <exclusion@gmail.com>
Дата:
Вложения:
Hello Kuroda-san,

27.05.2026 08:43, Hayato Kuroda (Fujitsu) wrote:
Hi Alexander,

I applied your reproducer atop my HEAD (12d00048), but I could not reproduce.
...

The build can be done if I restore changes in src/meson.build, but I could not
reproduce the failure if I run 035_standby_logicaldecoding.pl. Am I missing something?

I'm sorry, it looks like I had messed up with the patch. Please try the fixed one.
It makes the unmodified 035_standby_logical_decoding.pl fail for me as below:
 CPPFLAGS="-O0" ./configure -q --enable-debug --enable-tap-tests --enable-injection-points && make -s -j8 && PROVE_TESTS="t/035*" make -s check -C src/test/recovery/
...
# pg_recvlogical: error: could not send replication command "START_REPLICATION SLOT "drop_db_activeslot" LOGICAL 0/00000000 ("include-xids" '0', "skip-empty-xacts" '1')": server closed the connection unexpectedly
#       This probably means the server terminated abnormally
#       before or while processing the request.
# pg_recvlogical: error: disconnected
# '
#     doesn't match '(?^:conflict with recovery)'
t/035_standby_logical_decoding.pl .. 87/? # Looks like you failed 1 test of 89.
t/035_standby_logical_decoding.pl .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/89 subtests

Best regards,
Alexander

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

От:
"Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Дата:
Вложения:
Hi Alexander,

While sleeping, I came up with the idea; instead of waiting until the slot is
active, we can wait pg_recvlogical receives the ack from the walsender and enters
the loop. Attached patch implemented like that.

On my env, the patch could resolve the issue. How do you feel?

Best regards,
Hayato Kuroda
FUJITSU LIMITED

pgsql: Fix portability issue in authentication test 003_peer

От:
Michael Paquier <michael@paquier.xyz>
Дата:
Fix portability issue in authentication test 003_peer

The mapped user name is built upon the OS user name of the environment
where the test is run.  Depending on the characters used in the OS user
name, CREATE ROLE may not get parsed (the author has mentioned hyphens
as one case), causing a failure of the test.

Let's use double-quotes around the mapped user name, which should be a
solution good enough for the environments where this test tends to run.
The buildfarm issued no complaint over the years.

Oversight in 3c4e26a62c31, so backpatch down to v19.  Perhaps
3c4e26a62c31 and this commit should be backpatched further down, but
let's leave that for another day, if it proves necessary.

Author: Yugo Nagata 
Discussion: https://postgr.es/m/20260727133857.fbd23d43d422f10f376a8bee@sraoss.co.jp
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/123ea94f76b8efc9f45286e2ba55ee02bff5056c

Modified Files
--------------
src/test/authentication/t/003_peer.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
Вложения:
On Wed, Sep 2, 2026 at 2:42 PM Hayato Kuroda (Fujitsu)
 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

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

От:
"Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Дата:
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 

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

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Wed, Oct 21, 2026 at 3:37 PM Hayato Kuroda (Fujitsu)
 wrote:
> It meant existing codes might also be fixed, right?

Yes, probably. I haven't looked at the referenced code in detail yet, though..

> Good catch, LGTM.

Thanks for the review! I've pushed the patches.

Regards,

-- 
Fujii Masao


FAQ