mirror of https://github.com/citusdata/citus.git
Verify that we can replicate reference tables using rebalancer (#6232)
Co-authored-by: Marco Slot <marco.slot@gmail.com>pull/6227/head
parent
1dd775fae8
commit
bad8196da3
|
@ -774,6 +774,7 @@ SELECT 1 FROM master_remove_node('localhost', :worker_2_port);
|
|||
(1 row)
|
||||
|
||||
CREATE TABLE ref_table(a int);
|
||||
CREATE INDEX ON ref_table (a);
|
||||
SELECT create_reference_table('ref_table');
|
||||
create_reference_table
|
||||
---------------------------------------------------------------------
|
||||
|
@ -1039,6 +1040,25 @@ WHERE nodeport=:worker_1_port;
|
|||
0
|
||||
(1 row)
|
||||
|
||||
-- test that we can use non-blocking rebalance
|
||||
SELECT 1 FROM master_remove_node('localhost', :worker_2_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
(1 row)
|
||||
|
||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
(1 row)
|
||||
|
||||
SELECT rebalance_table_shards(shard_transfer_mode := 'force_logical');
|
||||
rebalance_table_shards
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
-- test that metadata is synced on replicate_reference_tables
|
||||
SELECT 1 FROM master_remove_node('localhost', :worker_2_port);
|
||||
?column?
|
||||
|
|
|
@ -506,6 +506,7 @@ ORDER BY 1,4,5;
|
|||
SELECT 1 FROM master_remove_node('localhost', :worker_2_port);
|
||||
|
||||
CREATE TABLE ref_table(a int);
|
||||
CREATE INDEX ON ref_table (a);
|
||||
SELECT create_reference_table('ref_table');
|
||||
INSERT INTO ref_table SELECT * FROM generate_series(1, 10);
|
||||
|
||||
|
@ -638,6 +639,12 @@ SELECT result::int - :ref_table_placements
|
|||
FROM run_command_on_workers('SELECT count(*) FROM pg_dist_placement a, pg_dist_shard b, pg_class c WHERE a.shardid=b.shardid AND b.logicalrelid=c.oid AND c.relname=''ref_table''')
|
||||
WHERE nodeport=:worker_1_port;
|
||||
|
||||
-- test that we can use non-blocking rebalance
|
||||
SELECT 1 FROM master_remove_node('localhost', :worker_2_port);
|
||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||
|
||||
SELECT rebalance_table_shards(shard_transfer_mode := 'force_logical');
|
||||
|
||||
-- test that metadata is synced on replicate_reference_tables
|
||||
SELECT 1 FROM master_remove_node('localhost', :worker_2_port);
|
||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||
|
|
Loading…
Reference in New Issue