Re: Logical replication launcher did not automatically restart when got SIGKILL
cca5507 <cca5507@qq.com>
From: cca5507 <cca5507@qq.com>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: shveta malik <shveta.malik@gmail.com>, Fujii Masao <masao.fujii@oss.nttdata.com>, pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-07-26T09:27:15Z
Lists: pgsql-hackers
Hi, The test case seems to have a problem: We cannot ensure that the SELECT happens after the pg_stat_activity can show the logical replication launcher. With the following patch the test will fail (without the patch it may happen very rarely): diff --git a/src/backend/replication/logical/launcher.c b/src/backend/replication/logical/launcher.c index 742d9ba68e9..1e155587c55 100644 --- a/src/backend/replication/logical/launcher.c +++ b/src/backend/replication/logical/launcher.c @@ -1162,6 +1162,7 @@ ApplyLauncherMain(Datum main_arg) * Establish connection to nailed catalogs (we only ever access * pg_subscription). */ + sleep(100); BackgroundWorkerInitializeConnection(NULL, NULL, 0); /* -- Regards, ChangAo Chen
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add regression test for background worker restart after crash.
- cc321b1d1c55 19 (unreleased) landed
-
Fix background worker not restarting after crash-and-restart cycle.
- 75f633f54aaa 18.0 landed
- b5d084c5353f 19 (unreleased) landed
-
Refactor code to handle death of a backend or bgworker in postmaster
- 28a520c0b773 18.0 cited