Skip to content

Commit 21305f0

Browse files
MasaoFujiiCommitfest Bot
authored andcommitted
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 b5d084c, 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
1 parent d5b9b2d commit 21305f0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/test/recovery/t/013_crash_restart.pl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,13 @@
228228
'before-orderly-restart',
229229
'can still write after crash restart');
230230

231+
# Confirm that the logical replication launcher, a background worker
232+
# without the never-restart flag, has also restarted successfully.
233+
is($node->poll_query_until('postgres',
234+
"SELECT count(*) = 1 FROM pg_stat_activity WHERE backend_type = 'logical replication launcher'"),
235+
'1',
236+
'logical replication launcher restarted after crash');
237+
231238
# Just to be sure, check that an orderly restart now still works
232239
$node->restart();
233240

0 commit comments

Comments
 (0)