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/2892135.1668976646@sss.pgh.pa.us
This commit is contained in:
Tom Lane 2022-11-21 10:50:50 -05:00
parent f193883fc9
commit e2933a6e11
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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