summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vondra2024-04-16 15:31:03 +0000
committerTomas Vondra2024-04-16 15:34:48 +0000
commit4d916dd876c3d9a4ceff5a0c54c5c58a0d1052e3 (patch)
tree136869bea9dce52f431b9d8c3b8a26124546ab22
parent03107b4eda7f2946bb78308cb088a513b718c793 (diff)
Stabilize test of BRIN parallel create
The test for parallel create of BRIN indexes added by commit 8225c2fd40 happens to be unstable - a background transaction (e.g. auto-analyze) may hold back global xmin for the initial VACUUM / CREATE INDEX. If the cleanup happens before the next CREATE INDEX, the indexes will not be exactly the same. This is the same issue as e2933a6e11, so fix it the same way by making the table TEMPORARY, which uses an up-to-date cutoff xmin that is not held back by other processes. Reported by Alexander Lakhin, who also suggested the fix. Author: Alexander Lakhin Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/[email protected]
-rw-r--r--contrib/pageinspect/expected/brin.out2
-rw-r--r--contrib/pageinspect/sql/brin.sql2
2 files changed, 2 insertions, 2 deletions
diff --git a/contrib/pageinspect/expected/brin.out b/contrib/pageinspect/expected/brin.out
index 67c3549a124..e59451af4b2 100644
--- a/contrib/pageinspect/expected/brin.out
+++ b/contrib/pageinspect/expected/brin.out
@@ -109,7 +109,7 @@ SELECT (COUNT(*) = (SELECT relpages FROM pg_class WHERE relname = 'test2')) AS r
DROP TABLE test1;
DROP TABLE test2;
-- Test that parallel index build produces the same BRIN index as serial build.
-CREATE TABLE brin_parallel_test (a int, b text, c bigint) WITH (fillfactor=40);
+CREATE TEMPORARY TABLE brin_parallel_test (a int, b text, c bigint) WITH (fillfactor=40);
-- Generate a table with a mix of NULLs and non-NULL values (and data suitable
-- for the different opclasses we build later).
INSERT INTO brin_parallel_test
diff --git a/contrib/pageinspect/sql/brin.sql b/contrib/pageinspect/sql/brin.sql
index a25969d58f0..ac375a427d1 100644
--- a/contrib/pageinspect/sql/brin.sql
+++ b/contrib/pageinspect/sql/brin.sql
@@ -56,7 +56,7 @@ DROP TABLE test1;
DROP TABLE test2;
-- Test that parallel index build produces the same BRIN index as serial build.
-CREATE TABLE brin_parallel_test (a int, b text, c bigint) WITH (fillfactor=40);
+CREATE TEMPORARY TABLE brin_parallel_test (a int, b text, c bigint) WITH (fillfactor=40);
-- Generate a table with a mix of NULLs and non-NULL values (and data suitable
-- for the different opclasses we build later).