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 -- Tests on distributed table with replication factor > 1
VACUUM (FULL) lineitem_hash_part; VACUUM (FULL) lineitem_hash_part;
SELECT citus_table_size('lineitem_hash_part'); -- citus_table_size, citus_relation_size and citus_total_relation_size should return the same value
citus_table_size -- 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) (1 row)
SELECT citus_relation_size('lineitem_hash_part'); SELECT citus_relation_size('lineitem_hash_part') = citus_total_relation_size('lineitem_hash_part');
citus_relation_size ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
3801088 t
(1 row) (1 row)
SELECT citus_total_relation_size('lineitem_hash_part'); SELECT citus_table_size('lineitem_hash_part') > 0;
citus_total_relation_size ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
3801088 t
(1 row) (1 row)
CREATE INDEX lineitem_hash_part_idx ON lineitem_hash_part(l_orderkey); CREATE INDEX lineitem_hash_part_idx ON lineitem_hash_part(l_orderkey);
VACUUM (FULL) lineitem_hash_part; VACUUM (FULL) lineitem_hash_part;
SELECT citus_table_size('lineitem_hash_part'); -- citus_table_size and citus_relation_size should return the same value
citus_table_size -- 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) (1 row)
SELECT citus_relation_size('lineitem_hash_part'); SELECT citus_table_size('lineitem_hash_part') > 0;
citus_relation_size ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
3801088 t
(1 row) (1 row)
SELECT citus_total_relation_size('lineitem_hash_part'); -- citus_table_size, citus_relation_size and citus_total_relation_size should return the same value
citus_total_relation_size -- 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) (1 row)
SELECT citus_table_size('lineitem_hash_part_idx'); SELECT citus_table_size('lineitem_hash_part_idx') = citus_total_relation_size('lineitem_hash_part_idx');
citus_table_size ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
458752 t
(1 row) (1 row)
SELECT citus_relation_size('lineitem_hash_part_idx'); SELECT citus_table_size('lineitem_hash_part_idx') > 0;
citus_relation_size ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
458752 t
(1 row) (1 row)
SELECT citus_total_relation_size('lineitem_hash_part_idx'); -- citus_total_relation_size should return the sum of table & index size
citus_total_relation_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) (1 row)
DROP INDEX lineitem_hash_part_idx; 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 -- Tests on distributed table with replication factor > 1
VACUUM (FULL) lineitem_hash_part; VACUUM (FULL) lineitem_hash_part;
SELECT citus_table_size('lineitem_hash_part'); -- citus_table_size, citus_relation_size and citus_total_relation_size should return the same value
SELECT citus_relation_size('lineitem_hash_part'); -- and that value should be greater than 0
SELECT citus_total_relation_size('lineitem_hash_part'); 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); CREATE INDEX lineitem_hash_part_idx ON lineitem_hash_part(l_orderkey);
VACUUM (FULL) lineitem_hash_part; VACUUM (FULL) lineitem_hash_part;
SELECT citus_table_size('lineitem_hash_part'); -- citus_table_size and citus_relation_size should return the same value
SELECT citus_relation_size('lineitem_hash_part'); -- and that value should be greater than 0
SELECT citus_total_relation_size('lineitem_hash_part'); 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'); -- citus_table_size, citus_relation_size and citus_total_relation_size should return the same value
SELECT citus_relation_size('lineitem_hash_part_idx'); -- and that value should be greater than 0
SELECT citus_total_relation_size('lineitem_hash_part_idx'); 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; DROP INDEX lineitem_hash_part_idx;