Fix autovacuum-induced flakiness in backwards scan test. Two of the permutations in backwards-scan-concurrent-splits rely on their VACUUM step deleting the leaf pages that the waiting backwards scan will have to recover from. VACUUM can only do that when it's able to remove the index tuples whose heap tuples the concurrent session just deleted. An autovacuum worker holding a snapshot holds back the removable cutoff, which leaves the pages non-empty, and so undeleted, causing the test to fail spuriously.
To fix, wait for the removable cutoff to advance past the deletions before the scan acquires its snapshot. This is much like commit 1c64d2fc, which dealt with the same hazard in nbtree_half_dead_pages by adding the wait_prunable() helper that we reuse here. Oversight in commit e395fbd3. Author: Peter Geoghegan <[email protected]> Reported-by: Alexander Lakhin <[email protected]> Discussion: https://postgr.es/m/[email protected] Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/23a6e25593729feaafb6f3491a1222247f6e0125 Modified Files -------------- .../expected/backwards-scan-concurrent-splits.out | 6 ++++-- .../specs/backwards-scan-concurrent-splits.spec | 24 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-)
