fix flakyness

pull/7271/head
Onur Tirtir 2023-10-31 18:20:53 +03:00
parent 6e6fcf411c
commit 61f16555b2
2 changed files with 53 additions and 36 deletions

View File

@ -37,60 +37,68 @@ SELECT replicate_table_shards('lineitem_hash_part', shard_replication_factor:=2,
-- Tests on distributed table with replication factor > 1
VACUUM (FULL) lineitem_hash_part;
SELECT citus_table_size('lineitem_hash_part');
citus_table_size
-- citus_table_size, citus_relation_size and citus_total_relation_size should return the same value
-- and that value should be greater than 0
SELECT citus_table_size('lineitem_hash_part') = citus_relation_size('lineitem_hash_part');
?column?
---------------------------------------------------------------------
3801088
t
(1 row)
SELECT citus_relation_size('lineitem_hash_part');
citus_relation_size
SELECT citus_relation_size('lineitem_hash_part') = citus_total_relation_size('lineitem_hash_part');
?column?
---------------------------------------------------------------------
3801088
t
(1 row)
SELECT citus_total_relation_size('lineitem_hash_part');
citus_total_relation_size
SELECT citus_table_size('lineitem_hash_part') > 0;
?column?
---------------------------------------------------------------------
3801088
t
(1 row)
CREATE INDEX lineitem_hash_part_idx ON lineitem_hash_part(l_orderkey);
VACUUM (FULL) lineitem_hash_part;
SELECT citus_table_size('lineitem_hash_part');
citus_table_size
-- citus_table_size and citus_relation_size should return the same value
-- and that value should be greater than 0
SELECT citus_table_size('lineitem_hash_part') = citus_relation_size('lineitem_hash_part');
?column?
---------------------------------------------------------------------
3801088
t
(1 row)
SELECT citus_relation_size('lineitem_hash_part');
citus_relation_size
SELECT citus_table_size('lineitem_hash_part') > 0;
?column?
---------------------------------------------------------------------
3801088
t
(1 row)
SELECT citus_total_relation_size('lineitem_hash_part');
citus_total_relation_size
-- citus_table_size, citus_relation_size and citus_total_relation_size should return the same value
-- and that value should be greater than 0
SELECT citus_table_size('lineitem_hash_part_idx') = citus_relation_size('lineitem_hash_part_idx');
?column?
---------------------------------------------------------------------
4259840
t
(1 row)
SELECT citus_table_size('lineitem_hash_part_idx');
citus_table_size
SELECT citus_table_size('lineitem_hash_part_idx') = citus_total_relation_size('lineitem_hash_part_idx');
?column?
---------------------------------------------------------------------
458752
t
(1 row)
SELECT citus_relation_size('lineitem_hash_part_idx');
citus_relation_size
SELECT citus_table_size('lineitem_hash_part_idx') > 0;
?column?
---------------------------------------------------------------------
458752
t
(1 row)
SELECT citus_total_relation_size('lineitem_hash_part_idx');
citus_total_relation_size
-- citus_total_relation_size should return the sum of table & index size
SELECT citus_total_relation_size('lineitem_hash_part') =
citus_table_size('lineitem_hash_part') + citus_table_size('lineitem_hash_part_idx');
?column?
---------------------------------------------------------------------
458752
t
(1 row)
DROP INDEX lineitem_hash_part_idx;

View File

@ -31,20 +31,29 @@ SELECT replicate_table_shards('lineitem_hash_part', shard_replication_factor:=2,
-- Tests on distributed table with replication factor > 1
VACUUM (FULL) lineitem_hash_part;
SELECT citus_table_size('lineitem_hash_part');
SELECT citus_relation_size('lineitem_hash_part');
SELECT citus_total_relation_size('lineitem_hash_part');
-- citus_table_size, citus_relation_size and citus_total_relation_size should return the same value
-- and that value should be greater than 0
SELECT citus_table_size('lineitem_hash_part') = citus_relation_size('lineitem_hash_part');
SELECT citus_relation_size('lineitem_hash_part') = citus_total_relation_size('lineitem_hash_part');
SELECT citus_table_size('lineitem_hash_part') > 0;
CREATE INDEX lineitem_hash_part_idx ON lineitem_hash_part(l_orderkey);
VACUUM (FULL) lineitem_hash_part;
SELECT citus_table_size('lineitem_hash_part');
SELECT citus_relation_size('lineitem_hash_part');
SELECT citus_total_relation_size('lineitem_hash_part');
-- citus_table_size and citus_relation_size should return the same value
-- and that value should be greater than 0
SELECT citus_table_size('lineitem_hash_part') = citus_relation_size('lineitem_hash_part');
SELECT citus_table_size('lineitem_hash_part') > 0;
SELECT citus_table_size('lineitem_hash_part_idx');
SELECT citus_relation_size('lineitem_hash_part_idx');
SELECT citus_total_relation_size('lineitem_hash_part_idx');
-- citus_table_size, citus_relation_size and citus_total_relation_size should return the same value
-- and that value should be greater than 0
SELECT citus_table_size('lineitem_hash_part_idx') = citus_relation_size('lineitem_hash_part_idx');
SELECT citus_table_size('lineitem_hash_part_idx') = citus_total_relation_size('lineitem_hash_part_idx');
SELECT citus_table_size('lineitem_hash_part_idx') > 0;
-- citus_total_relation_size should return the sum of table & index size
SELECT citus_total_relation_size('lineitem_hash_part') =
citus_table_size('lineitem_hash_part') + citus_table_size('lineitem_hash_part_idx');
DROP INDEX lineitem_hash_part_idx;