From: Melanie Plageman Date: Mon, 2 Feb 2026 22:44:37 +0000 (-0500) Subject: Fix flakiness in the pg_visibility VM-only vacuum test by using a temporary table. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a99ef1a0d11ed464295515635a44aad1b000691;p=thirdparty%2Fpostgresql.git Fix flakiness in the pg_visibility VM-only vacuum test by using a temporary table. 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 Author: Kirill Reshke Reviewed-by: Melanie Plageman Discussion: https://postgr.es/m/2b09fba6-6b71-497a-96ef-a6947fcc39f6%40gmail.com --- diff --git a/contrib/pg_visibility/expected/pg_visibility.out b/contrib/pg_visibility/expected/pg_visibility.out index e10f1706015..d26f0ab7589 100644 --- a/contrib/pg_visibility/expected/pg_visibility.out +++ b/contrib/pg_visibility/expected/pg_visibility.out @@ -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'); diff --git a/contrib/pg_visibility/sql/pg_visibility.sql b/contrib/pg_visibility/sql/pg_visibility.sql index 57af8a0c5b6..0888adb96a6 100644 --- a/contrib/pg_visibility/sql/pg_visibility.sql +++ b/contrib/pg_visibility/sql/pg_visibility.sql @@ -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');