summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao2025-07-29 10:43:10 +0000
committerFujii Masao2025-07-29 10:43:10 +0000
commitcc321b1d1c55fe208a394b0f8e0e99c5fb91742c (patch)
treeb1a448fcad5dc5bd7cc6a3256eb0da1b2a4adf31
parentcb833c1b6d19507b13a1a852feea4dbe5d6f0c20 (diff)
Add regression test for background worker restart after crash.
Previously, if a background worker crashed and the server restarted with restart_after_crash enabled, the worker was not restarted as expected. This issue was fixed by commit b5d084c5353, which ensures that background workers without the never-restart flag are correctly restarted after a crash-and-restart cycle. To guard against regressions, this commit adds a test that verifies a background worker successfully restarts in such a scenario. Author: Fujii Masao <[email protected]> Reviewed-by: ChangAo Chen <[email protected]> Discussion: https://postgr.es/m/CAHGQGwHF-PdUOgiXCH_8K5qBm8b13h0Qt=dSoFXZybXQdbf-tw@mail.gmail.com
-rw-r--r--src/test/recovery/t/013_crash_restart.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/recovery/t/013_crash_restart.pl b/src/test/recovery/t/013_crash_restart.pl
index debfa635c36..4c5af018ee4 100644
--- a/src/test/recovery/t/013_crash_restart.pl
+++ b/src/test/recovery/t/013_crash_restart.pl
@@ -228,6 +228,13 @@ is( $node->safe_psql(
'before-orderly-restart',
'can still write after crash restart');
+# Confirm that the logical replication launcher, a background worker
+# without the never-restart flag, has also restarted successfully.
+is($node->poll_query_until('postgres',
+ "SELECT count(*) = 1 FROM pg_stat_activity WHERE backend_type = 'logical replication launcher'"),
+ '1',
+ 'logical replication launcher restarted after crash');
+
# Just to be sure, check that an orderly restart now still works
$node->restart();