summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao2016-02-08 14:41:46 +0000
committerFujii Masao2016-02-08 14:41:46 +0000
commitf8a1c1d5a30003c9c24b00870d5a0f02f1c81e65 (patch)
tree315372127588fa1b1b63ec0f67ba3c3e01c29a79
parenta6897efab92bc7e645b6c6d15274b8d61c53fe8f (diff)
Make GIN regression test stable.
Commit 7f46eaf added the regression test which checks that gin_clean_pending_list() cleans up the GIN pending list and returns >0. This usually works fine. But if autovacuum comes along and cleans the list before gin_clean_pending_list() starts, the function may return 0, and then the regression test may fail. To fix the problem, this commit disables autovacuum on the target index of gin_clean_pending_list() by setting autovacuum_enabled reloption to off when creating the table. Also this commit sets gin_pending_list_limit reloption to 4MB on the target index. Otherwise when running "make installcheck" with small gin_pending_list_limit GUC, insertions of data may trigger the cleanup of pending list before gin_clean_pending_list() starts and the function may return 0. This could cause the regression test to fail. Per buildfarm member spoonbill. Reported-By: Tom Lane
-rw-r--r--src/test/regress/expected/gin.out5
-rw-r--r--src/test/regress/sql/gin.sql5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/test/regress/expected/gin.out b/src/test/regress/expected/gin.out
index cc7601c6677..a3911a6c6c9 100644
--- a/src/test/regress/expected/gin.out
+++ b/src/test/regress/expected/gin.out
@@ -4,8 +4,9 @@
-- There are other tests to test different GIN opclassed. This is for testing
-- GIN itself.
-- Create and populate a test table with a GIN index.
-create table gin_test_tbl(i int4[]);
-create index gin_test_idx on gin_test_tbl using gin (i) with (fastupdate = on);
+create table gin_test_tbl(i int4[]) with (autovacuum_enabled = off);
+create index gin_test_idx on gin_test_tbl using gin (i)
+ with (fastupdate = on, gin_pending_list_limit = 4096);
insert into gin_test_tbl select array[1, 2, g] from generate_series(1, 20000) g;
insert into gin_test_tbl select array[1, 3, g] from generate_series(1, 1000) g;
select gin_clean_pending_list('gin_test_idx')>10 as many; -- flush the fastupdate buffers
diff --git a/src/test/regress/sql/gin.sql b/src/test/regress/sql/gin.sql
index 31890b46d8c..c566e9b58c8 100644
--- a/src/test/regress/sql/gin.sql
+++ b/src/test/regress/sql/gin.sql
@@ -5,8 +5,9 @@
-- GIN itself.
-- Create and populate a test table with a GIN index.
-create table gin_test_tbl(i int4[]);
-create index gin_test_idx on gin_test_tbl using gin (i) with (fastupdate = on);
+create table gin_test_tbl(i int4[]) with (autovacuum_enabled = off);
+create index gin_test_idx on gin_test_tbl using gin (i)
+ with (fastupdate = on, gin_pending_list_limit = 4096);
insert into gin_test_tbl select array[1, 2, g] from generate_series(1, 20000) g;
insert into gin_test_tbl select array[1, 3, g] from generate_series(1, 1000) g;