summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2022-11-21 15:50:50 +0000
committerTom Lane2022-11-21 15:50:50 +0000
commite2933a6e11791191050cd925d52d34e785eece77 (patch)
treeed085f22f14202434f078c559a66fd43a2c81afa
parentf193883fc9cebe8fa20359b0797832837a788112 (diff)
Prevent instability in contrib/pageinspect's regression test.
pageinspect has occasionally failed on slow buildfarm members, with symptoms indicating that the expected effects of VACUUM FREEZE didn't happen. This is presumably because a background transaction such as auto-analyze was holding back global xmin. We can work around that by using a temp table in the test. Since commit a7212be8b, that will use an up-to-date cutoff xmin regardless of other processes. And pageinspect itself shouldn't really care whether the table is temp. Back-patch to v14. There would be no point in older branches without back-patching a7212be8b, which seems like more trouble than the problem is worth. Discussion: https://postgr.es/m/[email protected]
-rw-r--r--contrib/pageinspect/expected/page.out3
-rw-r--r--contrib/pageinspect/sql/page.sql3
2 files changed, 4 insertions, 2 deletions
diff --git a/contrib/pageinspect/expected/page.out b/contrib/pageinspect/expected/page.out
index 3bdc37bbf59..80ddb45a60a 100644
--- a/contrib/pageinspect/expected/page.out
+++ b/contrib/pageinspect/expected/page.out
@@ -1,5 +1,6 @@
CREATE EXTENSION pageinspect;
-CREATE TABLE test1 (a int, b int);
+-- Use a temp table so that effects of VACUUM are predictable
+CREATE TEMP TABLE test1 (a int, b int);
INSERT INTO test1 VALUES (16777217, 131584);
VACUUM (DISABLE_PAGE_SKIPPING) test1; -- set up FSM
-- The page contents can vary, so just test that it can be read
diff --git a/contrib/pageinspect/sql/page.sql b/contrib/pageinspect/sql/page.sql
index b5c41cc8ac5..5bff568d3b5 100644
--- a/contrib/pageinspect/sql/page.sql
+++ b/contrib/pageinspect/sql/page.sql
@@ -1,6 +1,7 @@
CREATE EXTENSION pageinspect;
-CREATE TABLE test1 (a int, b int);
+-- Use a temp table so that effects of VACUUM are predictable
+CREATE TEMP TABLE test1 (a int, b int);
INSERT INTO test1 VALUES (16777217, 131584);
VACUUM (DISABLE_PAGE_SKIPPING) test1; -- set up FSM