mirror of https://github.com/citusdata/citus.git
Update all citus_activate_node calls with SELECT 1
parent
76c3f3a1bf
commit
7c28ec132f
|
@ -45,10 +45,10 @@ BEFORE UPDATE OF value ON citus_local_table
|
|||
FOR EACH ROW EXECUTE FUNCTION dummy_function();')
|
||||
-- Show that we can activate node successfully. That means, we create
|
||||
-- the function that trigger needs in mx workers too.
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
16
|
||||
1
|
||||
(1 row)
|
||||
|
||||
CREATE EXTENSION seg;
|
||||
|
|
|
@ -129,10 +129,10 @@ SELECT citus.mitmproxy('conn.allow()');
|
|||
|
||||
(1 row)
|
||||
|
||||
SELECT citus_activate_node('localhost', :worker_2_proxy_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_2_proxy_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
4
|
||||
1
|
||||
(1 row)
|
||||
|
||||
SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_proxy_port;
|
||||
|
|
|
@ -28,16 +28,16 @@ SELECT create_distributed_table('t1', 'c');
|
|||
(1 row)
|
||||
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
SELECT citus_activate_node('localhost',:worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost',:worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
16
|
||||
1
|
||||
(1 row)
|
||||
|
||||
SELECT citus_activate_node('localhost',:worker_2_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost',:worker_2_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
30
|
||||
1
|
||||
(1 row)
|
||||
|
||||
\c - - - :worker_1_port
|
||||
|
|
|
@ -102,10 +102,10 @@ SELECT * FROM rebalance_table_shards();
|
|||
-- insert stuff into pg_dist_colocation
|
||||
TRUNCATE pg_dist_colocation;
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_colocationid_seq RESTART 1390000;
|
||||
SELECT * FROM citus_activate_node('localhost', :worker_2_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_2_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
3
|
||||
1
|
||||
(1 row)
|
||||
|
||||
CREATE TABLE cluster_management_test (col_1 text, col_2 int);
|
||||
|
|
|
@ -976,13 +976,13 @@ INSERT INTO citus.pg_dist_object(classid, objid, objsubid) values('pg_class'::re
|
|||
INSERT INTO citus.pg_dist_object(classid, objid, objsubid) values('pg_class'::regclass::oid, 'table3_group2'::regclass::oid, 0);
|
||||
INSERT INTO citus.pg_dist_object(classid, objid, objsubid) values('pg_class'::regclass::oid, 'table4_group2'::regclass::oid, 0);
|
||||
INSERT INTO citus.pg_dist_object(classid, objid, objsubid) values('pg_class'::regclass::oid, 'table5_groupX'::regclass::oid, 0);
|
||||
select 1 from citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
(1 row)
|
||||
|
||||
select 1 from citus_activate_node('localhost', :worker_2_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_2_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
|
|
|
@ -89,10 +89,10 @@ SELECT tablename, indexname FROM pg_indexes WHERE schemaname = 'fix_idx_names' A
|
|||
|
||||
\c - - - :master_port
|
||||
-- this should work properly
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
1
|
||||
(1 row)
|
||||
|
||||
\c - - - :worker_1_port
|
||||
|
|
|
@ -409,10 +409,10 @@ SELECT master_add_secondary_node('localhost', 8889, 'localhost', :worker_1_port,
|
|||
|
||||
\c - - - :master_port
|
||||
-- Run start_metadata_sync_to_node and citus_activate_node and check that it marked hasmetadata for that worker
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
1
|
||||
(1 row)
|
||||
|
||||
SELECT nodeid, hasmetadata FROM pg_dist_node WHERE nodename='localhost' AND nodeport=:worker_1_port;
|
||||
|
@ -527,10 +527,10 @@ SELECT create_distributed_table('mx_testing_schema_2.fk_test_2', 'col1');
|
|||
|
||||
(1 row)
|
||||
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
1
|
||||
(1 row)
|
||||
|
||||
-- Check that foreign key metadata exists on the worker
|
||||
|
@ -547,16 +547,16 @@ DROP TABLE mx_testing_schema.fk_test_1;
|
|||
RESET citus.shard_replication_factor;
|
||||
-- Check that repeated calls to citus_activate_node has no side effects
|
||||
\c - - - :master_port
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
1
|
||||
(1 row)
|
||||
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
1
|
||||
(1 row)
|
||||
|
||||
\c - - - :worker_1_port
|
||||
|
@ -639,10 +639,10 @@ SELECT count(*) FROM pg_trigger WHERE tgrelid='mx_testing_schema.mx_test_table':
|
|||
-- Make sure that citus_activate_node can be called inside a transaction and rollbacked
|
||||
\c - - - :master_port
|
||||
BEGIN;
|
||||
SELECT citus_activate_node('localhost', :worker_2_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_2_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
2
|
||||
1
|
||||
(1 row)
|
||||
|
||||
ROLLBACK;
|
||||
|
@ -655,10 +655,10 @@ SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_port;
|
|||
-- Check that the distributed table can be queried from the worker
|
||||
\c - - - :master_port
|
||||
SET citus.shard_replication_factor TO 1;
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
1
|
||||
(1 row)
|
||||
|
||||
CREATE TABLE mx_query_test (a int, b text, c int);
|
||||
|
@ -1129,10 +1129,10 @@ SELECT create_distributed_table('mx_table_with_small_sequence', 'a');
|
|||
|
||||
(1 row)
|
||||
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
1
|
||||
(1 row)
|
||||
|
||||
DROP TABLE mx_table_with_small_sequence;
|
||||
|
@ -1238,10 +1238,10 @@ SELECT nextval('mx_table_with_sequence_c_seq');
|
|||
|
||||
-- Check that adding a new metadata node sets the sequence space correctly
|
||||
\c - - - :master_port
|
||||
SELECT citus_activate_node('localhost', :worker_2_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_2_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
2
|
||||
1
|
||||
(1 row)
|
||||
|
||||
\c - - - :worker_2_port
|
||||
|
@ -2091,15 +2091,15 @@ ALTER SEQUENCE pg_catalog.pg_dist_node_nodeid_seq RESTART :last_node_id;
|
|||
ALTER SEQUENCE pg_catalog.pg_dist_colocationid_seq RESTART :last_colocation_id;
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_placement_placementid_seq RESTART :last_placement_id;
|
||||
-- Activate them at the end
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
1
|
||||
(1 row)
|
||||
|
||||
SELECT citus_activate_node('localhost', :worker_2_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_2_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
7
|
||||
1
|
||||
(1 row)
|
||||
|
||||
|
|
|
@ -698,10 +698,10 @@ SELECT create_reference_table('seq_test_10');
|
|||
INSERT INTO seq_test_10 VALUES (0);
|
||||
CREATE TABLE seq_test_11 (col0 int, col1 bigint DEFAULT nextval('seq_11'::text));
|
||||
-- works but doesn't create seq_11 in the workers
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
1
|
||||
(1 row)
|
||||
|
||||
-- works because there is no dependency created between seq_11 and seq_test_10
|
||||
|
@ -740,10 +740,10 @@ SELECT create_distributed_table('seq_test_12', 'col0');
|
|||
|
||||
(1 row)
|
||||
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
1
|
||||
(1 row)
|
||||
|
||||
INSERT INTO seq_test_12 VALUES ('hello0') RETURNING *;
|
||||
|
@ -846,10 +846,10 @@ ERROR: nextval: reached maximum value of sequence "seq_14" (32767)
|
|||
\c - - - :master_port
|
||||
SET citus.shard_replication_factor TO 1;
|
||||
SET search_path = sequence_default, public;
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
1
|
||||
(1 row)
|
||||
|
||||
SELECT undistribute_table('seq_test_12');
|
||||
|
|
|
@ -35,7 +35,7 @@ FOR EACH ROW EXECUTE FUNCTION dummy_function();
|
|||
|
||||
-- Show that we can activate node successfully. That means, we create
|
||||
-- the function that trigger needs in mx workers too.
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
|
||||
CREATE EXTENSION seg;
|
||||
ALTER TRIGGER dummy_function_trigger ON citus_local_table DEPENDS ON EXTENSION seg;
|
||||
|
|
|
@ -47,7 +47,7 @@ SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_proxy_port;
|
|||
|
||||
-- Verify we can activate node after unsuccessful attempts
|
||||
SELECT citus.mitmproxy('conn.allow()');
|
||||
SELECT citus_activate_node('localhost', :worker_2_proxy_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_2_proxy_port);
|
||||
SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_proxy_port;
|
||||
|
||||
-- Check failures on DDL command propagation
|
||||
|
|
|
@ -16,8 +16,8 @@ CREATE TABLE t1 (a int, b int, c int UNIQUE);
|
|||
SELECT create_distributed_table('t1', 'c');
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
|
||||
SELECT citus_activate_node('localhost',:worker_1_port);
|
||||
SELECT citus_activate_node('localhost',:worker_2_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost',:worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost',:worker_2_port);
|
||||
|
||||
\c - - - :worker_1_port
|
||||
SET search_path TO local_shard_execution_dropped_column;
|
||||
|
|
|
@ -48,7 +48,7 @@ SELECT * FROM rebalance_table_shards();
|
|||
TRUNCATE pg_dist_colocation;
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_colocationid_seq RESTART 1390000;
|
||||
|
||||
SELECT * FROM citus_activate_node('localhost', :worker_2_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_2_port);
|
||||
|
||||
CREATE TABLE cluster_management_test (col_1 text, col_2 int);
|
||||
SELECT create_distributed_table('cluster_management_test', 'col_1', 'hash');
|
||||
|
|
|
@ -416,8 +416,8 @@ INSERT INTO citus.pg_dist_object(classid, objid, objsubid) values('pg_class'::re
|
|||
INSERT INTO citus.pg_dist_object(classid, objid, objsubid) values('pg_class'::regclass::oid, 'table3_group2'::regclass::oid, 0);
|
||||
INSERT INTO citus.pg_dist_object(classid, objid, objsubid) values('pg_class'::regclass::oid, 'table4_group2'::regclass::oid, 0);
|
||||
INSERT INTO citus.pg_dist_object(classid, objid, objsubid) values('pg_class'::regclass::oid, 'table5_groupX'::regclass::oid, 0);
|
||||
select 1 from citus_activate_node('localhost', :worker_1_port);
|
||||
select 1 from citus_activate_node('localhost', :worker_2_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_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');
|
||||
|
|
|
@ -54,7 +54,7 @@ SELECT tablename, indexname FROM pg_indexes WHERE schemaname = 'fix_idx_names' A
|
|||
|
||||
\c - - - :master_port
|
||||
-- this should work properly
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
|
||||
\c - - - :worker_1_port
|
||||
-- we have no clashes
|
||||
|
|
|
@ -108,7 +108,7 @@ SELECT master_add_secondary_node('localhost', 8889, 'localhost', :worker_1_port,
|
|||
|
||||
\c - - - :master_port
|
||||
-- Run start_metadata_sync_to_node and citus_activate_node and check that it marked hasmetadata for that worker
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
|
||||
SELECT nodeid, hasmetadata FROM pg_dist_node WHERE nodename='localhost' AND nodeport=:worker_1_port;
|
||||
|
||||
|
@ -147,7 +147,7 @@ CREATE TABLE mx_testing_schema_2.fk_test_2 (col1 int, col2 int, col3 text,
|
|||
SELECT create_distributed_table('mx_testing_schema.fk_test_1', 'col1');
|
||||
SELECT create_distributed_table('mx_testing_schema_2.fk_test_2', 'col1');
|
||||
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
|
||||
-- Check that foreign key metadata exists on the worker
|
||||
\c - - - :worker_1_port
|
||||
|
@ -161,8 +161,8 @@ RESET citus.shard_replication_factor;
|
|||
|
||||
-- Check that repeated calls to citus_activate_node has no side effects
|
||||
\c - - - :master_port
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
\c - - - :worker_1_port
|
||||
SELECT * FROM pg_dist_local_group;
|
||||
SELECT * FROM pg_dist_node ORDER BY nodeid;
|
||||
|
@ -179,7 +179,7 @@ SELECT count(*) FROM pg_trigger WHERE tgrelid='mx_testing_schema.mx_test_table':
|
|||
-- Make sure that citus_activate_node can be called inside a transaction and rollbacked
|
||||
\c - - - :master_port
|
||||
BEGIN;
|
||||
SELECT citus_activate_node('localhost', :worker_2_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_2_port);
|
||||
ROLLBACK;
|
||||
|
||||
SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_port;
|
||||
|
@ -187,7 +187,7 @@ SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_port;
|
|||
-- Check that the distributed table can be queried from the worker
|
||||
\c - - - :master_port
|
||||
SET citus.shard_replication_factor TO 1;
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
|
||||
CREATE TABLE mx_query_test (a int, b text, c int);
|
||||
SELECT create_distributed_table('mx_query_test', 'a');
|
||||
|
@ -446,7 +446,7 @@ SELECT stop_metadata_sync_to_node('localhost', :worker_2_port);
|
|||
-- sync table with serial column after create_distributed_table
|
||||
CREATE TABLE mx_table_with_small_sequence(a int, b SERIAL, c SMALLSERIAL);
|
||||
SELECT create_distributed_table('mx_table_with_small_sequence', 'a');
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
DROP TABLE mx_table_with_small_sequence;
|
||||
|
||||
-- Show that create_distributed_table works with a serial column
|
||||
|
@ -491,7 +491,7 @@ SELECT nextval('mx_table_with_sequence_c_seq');
|
|||
|
||||
-- Check that adding a new metadata node sets the sequence space correctly
|
||||
\c - - - :master_port
|
||||
SELECT citus_activate_node('localhost', :worker_2_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_2_port);
|
||||
|
||||
\c - - - :worker_2_port
|
||||
SELECT groupid FROM pg_dist_local_group;
|
||||
|
@ -873,5 +873,5 @@ ALTER SEQUENCE pg_catalog.pg_dist_colocationid_seq RESTART :last_colocation_id;
|
|||
ALTER SEQUENCE pg_catalog.pg_dist_placement_placementid_seq RESTART :last_placement_id;
|
||||
|
||||
-- Activate them at the end
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT citus_activate_node('localhost', :worker_2_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_2_port);
|
||||
|
|
|
@ -340,7 +340,7 @@ SELECT create_reference_table('seq_test_10');
|
|||
INSERT INTO seq_test_10 VALUES (0);
|
||||
CREATE TABLE seq_test_11 (col0 int, col1 bigint DEFAULT nextval('seq_11'::text));
|
||||
-- works but doesn't create seq_11 in the workers
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
-- works because there is no dependency created between seq_11 and seq_test_10
|
||||
SELECT create_distributed_table('seq_test_11', 'col1');
|
||||
-- insertion from workers fails
|
||||
|
@ -362,7 +362,7 @@ CREATE TABLE seq_test_12(col0 text, col1 smallint DEFAULT nextval('seq_12'),
|
|||
col2 int DEFAULT nextval('seq_13'),
|
||||
col3 bigint DEFAULT nextval('seq_14'));
|
||||
SELECT create_distributed_table('seq_test_12', 'col0');
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
INSERT INTO seq_test_12 VALUES ('hello0') RETURNING *;
|
||||
|
||||
\c - - - :worker_1_port
|
||||
|
@ -417,7 +417,7 @@ SELECT nextval('seq_14');
|
|||
\c - - - :master_port
|
||||
SET citus.shard_replication_factor TO 1;
|
||||
SET search_path = sequence_default, public;
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT 1 FROM citus_activate_node('localhost', :worker_1_port);
|
||||
SELECT undistribute_table('seq_test_12');
|
||||
SELECT create_distributed_table('seq_test_12', 'col0');
|
||||
INSERT INTO seq_test_12 VALUES ('hello2') RETURNING *;
|
||||
|
|
Loading…
Reference in New Issue