]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix flakiness in the pg_visibility VM-only vacuum test by using a temporary table.
authorMelanie Plageman <melanieplageman@gmail.com>
Mon, 2 Feb 2026 22:44:37 +0000 (17:44 -0500)
committerMelanie Plageman <melanieplageman@gmail.com>
Mon, 2 Feb 2026 22:45:27 +0000 (17:45 -0500)
The test relies on VACUUM being able to mark a page all-visible, but
this can fail when autovacuum in other sessions prevents the visibility
horizon from advancing. Making the test table temporary isolates its
horizon from other sessions, including catalog table vacuums, ensuring
reliable test behavior.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/2b09fba6-6b71-497a-96ef-a6947fcc39f6%40gmail.com

contrib/pg_visibility/expected/pg_visibility.out
contrib/pg_visibility/sql/pg_visibility.sql

index e10f1706015f499e433cafb147b472f547db39e7..d26f0ab7589f91140ba744a74fd2e503801b6537 100644 (file)
@@ -207,7 +207,7 @@ select pg_truncate_visibility_map('test_partition');
 
 -- test the case where vacuum phase I does not need to modify the heap buffer
 -- and only needs to set the VM
-create table test_vac_unmodified_heap(a int);
+create temp table test_vac_unmodified_heap(a int);
 insert into test_vac_unmodified_heap values (1);
 vacuum (freeze) test_vac_unmodified_heap;
 select pg_visibility_map_summary('test_vac_unmodified_heap');
index 57af8a0c5b64a0bd9e1d39c9b7aedf5724313138..0888adb96a6fea149982e057e573abd561bbf922 100644 (file)
@@ -97,7 +97,7 @@ select pg_truncate_visibility_map('test_partition');
 
 -- test the case where vacuum phase I does not need to modify the heap buffer
 -- and only needs to set the VM
-create table test_vac_unmodified_heap(a int);
+create temp table test_vac_unmodified_heap(a int);
 insert into test_vac_unmodified_heap values (1);
 vacuum (freeze) test_vac_unmodified_heap;
 select pg_visibility_map_summary('test_vac_unmodified_heap');