Add regression test for restart points during promotion

This test serves as a way to demonstrate how to use the features
introduced in 37b369dc67bc, while providing coverage for 7863ee4def65
that caused the startup process to throw "PANIC: could not locate a
valid checkpoint record" when starting recovery.  The test checks that a
node is able to properly restart following a crash when a restart point
was finishing across a promotion, with an injection point added in the
middle of CreateRestartPoint() to stop the restartpoint in flight.  Note
that this test fails when 7863ee4def65 is reverted.

Kyotaro Horiguchi is the original author of this test, that has been
originally posted on the thread where 7863ee4def65 was discussed.  I
have just upgraded and polished it to rely on injection points, making
it much cheaper to reproduce the failure.

This test requires injection points to be enabled in the builds, hence
meson and ./configure need an update to pass this knowledge down to the
test.  The name of the new injection point follows the same naming
convention as 6a1ea02c491d.  The Makefile's EXTRA_INSTALL of recovery
TAP tests is updated to include modules/injection_points.

Author: Kyotaro Horiguchi, Michael Paquier
Reviewed-by: Andrey Borodin, Bertrand Drouvot
Discussion: https://postgr.es/m/zdluxbk5hgpol...@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6782709df81f6c68450172605907fa9ff2b7f2b1

Modified Files
--------------
src/backend/access/transam/xlog.c                |   7 +
src/test/recovery/Makefile                       |   7 +-
src/test/recovery/meson.build                    |   4 +
src/test/recovery/t/041_checkpoint_at_promote.pl | 170 +++++++++++++++++++++++
4 files changed, 187 insertions(+), 1 deletion(-)

Reply via email to