From 24e695ca27bb4caf69faca056d1e1d6ef95fffae Mon Sep 17 00:00:00 2001 From: Jelte Fennema Date: Tue, 30 Aug 2022 23:32:34 +0200 Subject: [PATCH] Fix flakyness in multi_utilities (#6272) Sometimes in CI our multi_utilities test fails like this: ```diff VACUUM (INDEX_CLEANUP ON, PARALLEL 1) local_vacuum_table; SELECT CASE WHEN s BETWEEN 20000000 AND 25000000 THEN 22500000 ELSE s END size FROM pg_total_relation_size('local_vacuum_table') s ; size ---------- - 22500000 + 39518208 (1 row) ``` Source: https://app.circleci.com/pipelines/github/citusdata/citus/26641/workflows/5caea99c-9f58-4baa-839a-805aea714628/jobs/762870 Apparently VACUUM is not as reliable in cleaning up as we thought. This increases the range of allowed values. Important to note is that the range is still completely outside of the allowed range of the initial size. So we know for sure that some data was cleaned up. --- src/test/regress/expected/multi_utilities.out | 4 ++-- src/test/regress/sql/multi_utilities.sql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/regress/expected/multi_utilities.out b/src/test/regress/expected/multi_utilities.out index 30c685a35..c5a0be4c8 100644 --- a/src/test/regress/expected/multi_utilities.out +++ b/src/test/regress/expected/multi_utilities.out @@ -410,11 +410,11 @@ FROM pg_total_relation_size('local_vacuum_table') s ; insert into local_vacuum_table select i from generate_series(1,1000000) i; delete from local_vacuum_table; VACUUM (INDEX_CLEANUP ON, PARALLEL 1) local_vacuum_table; -SELECT CASE WHEN s BETWEEN 20000000 AND 25000000 THEN 22500000 ELSE s END size +SELECT CASE WHEN s BETWEEN 20000000 AND 49999999 THEN 35000000 ELSE s END size FROM pg_total_relation_size('local_vacuum_table') s ; size --------------------------------------------------------------------- - 22500000 + 35000000 (1 row) -- vacuum (truncate false) should not attempt to truncate off any empty pages at the end of the table (default is true) diff --git a/src/test/regress/sql/multi_utilities.sql b/src/test/regress/sql/multi_utilities.sql index f84d4cf85..86d86603b 100644 --- a/src/test/regress/sql/multi_utilities.sql +++ b/src/test/regress/sql/multi_utilities.sql @@ -263,7 +263,7 @@ FROM pg_total_relation_size('local_vacuum_table') s ; insert into local_vacuum_table select i from generate_series(1,1000000) i; delete from local_vacuum_table; VACUUM (INDEX_CLEANUP ON, PARALLEL 1) local_vacuum_table; -SELECT CASE WHEN s BETWEEN 20000000 AND 25000000 THEN 22500000 ELSE s END size +SELECT CASE WHEN s BETWEEN 20000000 AND 49999999 THEN 35000000 ELSE s END size FROM pg_total_relation_size('local_vacuum_table') s ; -- vacuum (truncate false) should not attempt to truncate off any empty pages at the end of the table (default is true)