Merge pull request #5630 from citusdata/multi_colocation_utils-turn-mx-on

Turn mx on for test: multi_colocation_utils
pull/5642/head
Ahmet Gedemenli 2022-01-21 19:48:00 +03:00 committed by GitHub
commit 577224cf23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 3 deletions

View File

@ -52,6 +52,16 @@ CREATE FUNCTION find_shard_interval_index(bigint)
RETURNS int
AS 'citus'
LANGUAGE C STRICT;
-- remove tables from pg_dist_partition, if they don't exist i.e not found in pg_class
delete from pg_dist_partition where not exists(select * from pg_class where pg_class.oid=pg_dist_partition.logicalrelid);
select 1 from run_command_on_workers($$
delete from pg_dist_partition where not exists(select * from pg_class where pg_class.oid=pg_dist_partition.logicalrelid);$$);
?column?
---------------------------------------------------------------------
1
1
(2 rows)
-- ===================================================================
-- test co-location util functions
-- ===================================================================
@ -958,6 +968,33 @@ SELECT update_distributed_table_colocation('table1_group_none', colocate_with =>
(1 row)
-- sync metadata to get rid of inconsistencies in pg_dist tables
select stop_metadata_sync_to_node('localhost', :worker_1_port);
NOTICE: dropping metadata on the node (localhost,57637)
stop_metadata_sync_to_node
---------------------------------------------------------------------
(1 row)
select stop_metadata_sync_to_node('localhost', :worker_2_port);
NOTICE: dropping metadata on the node (localhost,57638)
stop_metadata_sync_to_node
---------------------------------------------------------------------
(1 row)
select start_metadata_sync_to_node('localhost', :worker_1_port);
start_metadata_sync_to_node
---------------------------------------------------------------------
(1 row)
select start_metadata_sync_to_node('localhost', :worker_2_port);
start_metadata_sync_to_node
---------------------------------------------------------------------
(1 row)
-- move a table with a colocation id which is already not in pg_dist_colocation
SELECT update_distributed_table_colocation('table1_group_none', colocate_with => 'table2_group_none');
update_distributed_table_colocation

View File

@ -249,10 +249,7 @@ test: multi_truncate
# multi_colocation_utils tests utility functions written for co-location feature & internal API
# multi_colocated_shard_transfer tests master_copy_shard_placement with colocated tables.
# ----------
test: check_mx
test: turn_mx_off
test: multi_colocation_utils
test: turn_mx_on
test: multi_colocated_shard_transfer
# ----------

View File

@ -62,6 +62,11 @@ CREATE FUNCTION find_shard_interval_index(bigint)
AS 'citus'
LANGUAGE C STRICT;
-- remove tables from pg_dist_partition, if they don't exist i.e not found in pg_class
delete from pg_dist_partition where not exists(select * from pg_class where pg_class.oid=pg_dist_partition.logicalrelid);
select 1 from run_command_on_workers($$
delete from pg_dist_partition where not exists(select * from pg_class where pg_class.oid=pg_dist_partition.logicalrelid);$$);
-- ===================================================================
-- test co-location util functions
-- ===================================================================
@ -404,6 +409,12 @@ SELECT update_distributed_table_colocation('table1_group_none', colocate_with =>
SELECT update_distributed_table_colocation('table1_group_none', colocate_with => 'table2_groupE');
SELECT update_distributed_table_colocation('table1_group_none', colocate_with => 'table3_groupE');
-- sync metadata to get rid of inconsistencies in pg_dist tables
select stop_metadata_sync_to_node('localhost', :worker_1_port);
select stop_metadata_sync_to_node('localhost', :worker_2_port);
select start_metadata_sync_to_node('localhost', :worker_1_port);
select start_metadata_sync_to_node('localhost', :worker_2_port);
-- move a table with a colocation id which is already not in pg_dist_colocation
SELECT update_distributed_table_colocation('table1_group_none', colocate_with => 'table2_group_none');