Improve runtime and output of tests for replication slots checkpointing.
authorAlexander Korotkov <[email protected]>
Thu, 19 Jun 2025 22:41:28 +0000 (01:41 +0300)
committerAlexander Korotkov <[email protected]>
Thu, 19 Jun 2025 22:41:28 +0000 (01:41 +0300)
commit4464fddf7b50abe3dbb462f76fd925e10eedad1c
tree6659858f8772016dbefac3a16e76abdd9b71751c
parenta8360f074cc03a7cb73a4aaa6d8caab0e0bf0a0f
Improve runtime and output of tests for replication slots checkpointing.

The TAP tests that verify logical and physical replication slot behavior
during checkpoints (046_checkpoint_logical_slot.pl and
047_checkpoint_physical_slot.pl) inserted two batches of 2 million rows each,
generating approximately 520 MB of WAL.  On slow machines, or when compiled
with '-DRELCACHE_FORCE_RELEASE -DCATCACHE_FORCE_RELEASE', this caused the
tests to run for 8-9 minutes and occasionally time out, as seen on the
buildfarm animal prion.

This commit modifies the mentioned tests to utilize the $node->advance_wal()
function, thereby reducing runtime. Once we do not use the generated data,
the proposed function is a good alternative, which cuts the total wall-clock
run time.

While here, remove superfluous '\n' characters from several note() calls;
these appeared literally in the build-farm logs and looked odd.  Also, remove
excessive 'shared_preload_libraries' GUC from the config and add a check for
'injection_points' extension availability.

Reported-by: Alexander Lakhin <[email protected]>
Reported-by: Tom Lane <[email protected]>
Author: Alexander Korotkov <[email protected]>
Author: Vitaly Davydov <[email protected]>
Reviewed-by: Hayato Kuroda <[email protected]>
Discussion: https://postgr.es/m/fbc5d94e-6fbd-4a64-85d4-c9e284a58eb2%40gmail.com
Backpatch-through: 17
src/test/recovery/t/046_checkpoint_logical_slot.pl
src/test/recovery/t/047_checkpoint_physical_slot.pl