add multi follower repartition tests

pull/4005/head
Sait Talha Nisanci 2020-07-13 19:37:17 +03:00
parent 510535f558
commit 1b5ed45a58
2 changed files with 38 additions and 0 deletions

View File

@ -33,6 +33,21 @@ SELECT create_distributed_table('stock','s_w_id');
(1 row) (1 row)
INSERT INTO stock SELECT c, c, c FROM generate_series(1, 5) as c; INSERT INTO stock SELECT c, c, c FROM generate_series(1, 5) as c;
SET citus.enable_repartition_joins TO ON;
SELECT count(*) FROM the_table t1 JOIN the_table t2 USING(b);
count
---------------------------------------------------------------------
2
(1 row)
SET citus.enable_single_hash_repartition_joins TO ON;
SELECT count(*) FROM the_table t1 , the_table t2 WHERE t1.a = t2.b;
count
---------------------------------------------------------------------
2
(1 row)
RESET citus.enable_repartition_joins;
-- connect to the follower and check that a simple select query works, the follower -- connect to the follower and check that a simple select query works, the follower
-- is still in the default cluster and will send queries to the primary nodes -- is still in the default cluster and will send queries to the primary nodes
\c - - - :follower_master_port \c - - - :follower_master_port
@ -100,6 +115,14 @@ order by s_i_id;
5 | 5 5 | 5
(3 rows) (3 rows)
SET citus.enable_repartition_joins TO ON;
SELECT count(*) FROM the_table t1 JOIN the_table t2 USING(b);
ERROR: writing to worker nodes is not currently allowed
DETAIL: the database is read-only
SET citus.enable_single_hash_repartition_joins TO ON;
SELECT count(*) FROM the_table t1 , the_table t2 WHERE t1.a = t2.b;
ERROR: writing to worker nodes is not currently allowed
DETAIL: the database is read-only
SELECT SELECT
node_name, node_port node_name, node_port
FROM FROM

View File

@ -21,6 +21,14 @@ SELECT create_distributed_table('stock','s_w_id');
INSERT INTO stock SELECT c, c, c FROM generate_series(1, 5) as c; INSERT INTO stock SELECT c, c, c FROM generate_series(1, 5) as c;
SET citus.enable_repartition_joins TO ON;
SELECT count(*) FROM the_table t1 JOIN the_table t2 USING(b);
SET citus.enable_single_hash_repartition_joins TO ON;
SELECT count(*) FROM the_table t1 , the_table t2 WHERE t1.a = t2.b;
RESET citus.enable_repartition_joins;
-- connect to the follower and check that a simple select query works, the follower -- connect to the follower and check that a simple select query works, the follower
-- is still in the default cluster and will send queries to the primary nodes -- is still in the default cluster and will send queries to the primary nodes
@ -66,6 +74,13 @@ group by s_i_id
having sum(s_order_cnt) > (select max(s_order_cnt) - 3 as having_query from stock) having sum(s_order_cnt) > (select max(s_order_cnt) - 3 as having_query from stock)
order by s_i_id; order by s_i_id;
SET citus.enable_repartition_joins TO ON;
SELECT count(*) FROM the_table t1 JOIN the_table t2 USING(b);
SET citus.enable_single_hash_repartition_joins TO ON;
SELECT count(*) FROM the_table t1 , the_table t2 WHERE t1.a = t2.b;
SELECT SELECT
node_name, node_port node_name, node_port