mirror of https://github.com/citusdata/citus.git
Fix MX tests
parent
9fc09947ed
commit
0c506606cd
|
@ -43,12 +43,12 @@ FOR EACH ROW EXECUTE FUNCTION dummy_function();
|
|||
NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (1508000, 'citus_local_tables_mx', 'CREATE TRIGGER dummy_function_trigger
|
||||
BEFORE UPDATE OF value ON citus_local_table
|
||||
FOR EACH ROW EXECUTE FUNCTION dummy_function();')
|
||||
-- Show that we can sync metadata successfully. That means, we create
|
||||
-- Show that we can activate node successfully. That means, we create
|
||||
-- the function that trigger needs in mx workers too.
|
||||
SELECT start_metadata_sync_to_node('localhost', :worker_1_port);
|
||||
start_metadata_sync_to_node
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
citus_activate_node
|
||||
---------------------------------------------------------------------
|
||||
|
||||
16
|
||||
(1 row)
|
||||
|
||||
CREATE EXTENSION seg;
|
||||
|
|
|
@ -52,17 +52,9 @@ SELECT create_distributed_table('collections_list', 'key');
|
|||
CREATE TABLE collections_list_0
|
||||
PARTITION OF collections_list (key, collection_id)
|
||||
FOR VALUES IN ( 0 );
|
||||
DEBUG: relation "collections_list_key_seq" already exists, skipping
|
||||
DETAIL: from localhost:xxxxx
|
||||
DEBUG: relation "collections_list_key_seq" already exists, skipping
|
||||
DETAIL: from localhost:xxxxx
|
||||
CREATE TABLE collections_list_1
|
||||
PARTITION OF collections_list (key, collection_id)
|
||||
FOR VALUES IN ( 1 );
|
||||
DEBUG: relation "collections_list_key_seq" already exists, skipping
|
||||
DETAIL: from localhost:xxxxx
|
||||
DEBUG: relation "collections_list_key_seq" already exists, skipping
|
||||
DETAIL: from localhost:xxxxx
|
||||
-- connection worker and get ready for the tests
|
||||
\c - - - :worker_1_port
|
||||
SET search_path TO local_shard_copy;
|
||||
|
|
|
@ -28,16 +28,16 @@ SELECT create_distributed_table('t1', 'c');
|
|||
(1 row)
|
||||
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
SELECT start_metadata_sync_to_node('localhost',:worker_1_port);
|
||||
start_metadata_sync_to_node
|
||||
SELECT citus_activate_node('localhost',:worker_1_port);
|
||||
citus_activate_node
|
||||
---------------------------------------------------------------------
|
||||
|
||||
16
|
||||
(1 row)
|
||||
|
||||
SELECT start_metadata_sync_to_node('localhost',:worker_2_port);
|
||||
start_metadata_sync_to_node
|
||||
SELECT citus_activate_node('localhost',:worker_2_port);
|
||||
citus_activate_node
|
||||
---------------------------------------------------------------------
|
||||
|
||||
30
|
||||
(1 row)
|
||||
|
||||
\c - - - :worker_1_port
|
||||
|
|
|
@ -25,17 +25,8 @@ WITH dist_node_summary AS (
|
|||
master_run_on_worker(ARRAY[hostname, 'localhost'], ARRAY[port, master_port],
|
||||
ARRAY[dist_node_summary.query, dist_node_summary.query],
|
||||
false)
|
||||
), dist_placement_summary AS (
|
||||
SELECT 'SELECT jsonb_agg(pg_dist_placement ORDER BY placementid) FROM pg_dist_placement' AS query
|
||||
), dist_placement_check AS (
|
||||
SELECT count(distinct result) = 1 AS matches
|
||||
FROM dist_placement_summary CROSS JOIN LATERAL
|
||||
master_run_on_worker(ARRAY[hostname, 'localhost'], ARRAY[port, master_port],
|
||||
ARRAY[dist_placement_summary.query, dist_placement_summary.query],
|
||||
false)
|
||||
)
|
||||
SELECT dist_node_check.matches AND dist_placement_check.matches
|
||||
FROM dist_node_check CROSS JOIN dist_placement_check
|
||||
SELECT dist_node_check.matches FROM dist_node_check
|
||||
$$;
|
||||
-- partition_task_list_results tests the internal PartitionTasklistResults function
|
||||
CREATE OR REPLACE FUNCTION pg_catalog.partition_task_list_results(resultIdPrefix text,
|
||||
|
|
|
@ -251,24 +251,6 @@ SELECT count(*) > 0 FROM pg_dist_node;
|
|||
f
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) > 0 FROM pg_dist_shard;
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
f
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'distributed_table__' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = 'start_stop_metadata_sync');
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
f
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'reference_table__' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = 'start_stop_metadata_sync');
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
f
|
||||
(1 row)
|
||||
|
||||
\c - - - :master_port
|
||||
SET search_path TO "start_stop_metadata_sync";
|
||||
SELECT * FROM distributed_table_1;
|
||||
|
@ -291,24 +273,6 @@ SELECT count(*) > 0 FROM pg_dist_node;
|
|||
t
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) > 0 FROM pg_dist_shard;
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
t
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'distributed_table__' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = 'start_stop_metadata_sync');
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
t
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'reference_table__' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = 'start_stop_metadata_sync');
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
t
|
||||
(1 row)
|
||||
|
||||
\c - - - :master_port
|
||||
-- test synchronization for pg_dist_node flags
|
||||
SELECT citus_set_node_property('localhost', :worker_2_port, 'shouldhaveshards', false);
|
||||
|
@ -460,24 +424,6 @@ SELECT count(*) > 0 FROM pg_dist_node;
|
|||
f
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) > 0 FROM pg_dist_shard;
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
f
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'distributed_table__' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = 'start_stop_metadata_sync');
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
f
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'reference_table__' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = 'start_stop_metadata_sync');
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
f
|
||||
(1 row)
|
||||
|
||||
\c - - - :master_port
|
||||
SET search_path TO "start_stop_metadata_sync";
|
||||
-- start metadata sync sets the multi-shard modify mode to sequential
|
||||
|
|
|
@ -33,10 +33,9 @@ CREATE TRIGGER dummy_function_trigger
|
|||
BEFORE UPDATE OF value ON citus_local_table
|
||||
FOR EACH ROW EXECUTE FUNCTION dummy_function();
|
||||
|
||||
-- Show that we can sync metadata successfully. That means, we create
|
||||
-- Show that we can activate node successfully. That means, we create
|
||||
-- the function that trigger needs in mx workers too.
|
||||
-- TODO: Metadata sync won't propagate objects anymore
|
||||
SELECT start_metadata_sync_to_node('localhost', :worker_1_port);
|
||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||
|
||||
CREATE EXTENSION seg;
|
||||
ALTER TRIGGER dummy_function_trigger ON citus_local_table DEPENDS ON EXTENSION seg;
|
||||
|
|
|
@ -16,9 +16,8 @@ CREATE TABLE t1 (a int, b int, c int UNIQUE);
|
|||
SELECT create_distributed_table('t1', 'c');
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
|
||||
-- Syncing metadata won't propagate t1
|
||||
SELECT start_metadata_sync_to_node('localhost',:worker_1_port);
|
||||
SELECT start_metadata_sync_to_node('localhost',:worker_2_port);
|
||||
SELECT citus_activate_node('localhost',:worker_1_port);
|
||||
SELECT citus_activate_node('localhost',:worker_2_port);
|
||||
|
||||
\c - - - :worker_1_port
|
||||
SET search_path TO local_shard_execution_dropped_column;
|
||||
|
|
|
@ -22,17 +22,8 @@ WITH dist_node_summary AS (
|
|||
master_run_on_worker(ARRAY[hostname, 'localhost'], ARRAY[port, master_port],
|
||||
ARRAY[dist_node_summary.query, dist_node_summary.query],
|
||||
false)
|
||||
), dist_placement_summary AS (
|
||||
SELECT 'SELECT jsonb_agg(pg_dist_placement ORDER BY placementid) FROM pg_dist_placement' AS query
|
||||
), dist_placement_check AS (
|
||||
SELECT count(distinct result) = 1 AS matches
|
||||
FROM dist_placement_summary CROSS JOIN LATERAL
|
||||
master_run_on_worker(ARRAY[hostname, 'localhost'], ARRAY[port, master_port],
|
||||
ARRAY[dist_placement_summary.query, dist_placement_summary.query],
|
||||
false)
|
||||
)
|
||||
SELECT dist_node_check.matches AND dist_placement_check.matches
|
||||
FROM dist_node_check CROSS JOIN dist_placement_check
|
||||
SELECT dist_node_check.matches FROM dist_node_check
|
||||
$$;
|
||||
|
||||
|
||||
|
|
|
@ -131,9 +131,6 @@ SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'reference_table__' AND rel
|
|||
SET search_path TO "start_stop_metadata_sync";
|
||||
|
||||
SELECT count(*) > 0 FROM pg_dist_node;
|
||||
SELECT count(*) > 0 FROM pg_dist_shard;
|
||||
SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'distributed_table__' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = 'start_stop_metadata_sync');
|
||||
SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'reference_table__' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = 'start_stop_metadata_sync');
|
||||
|
||||
\c - - - :master_port
|
||||
SET search_path TO "start_stop_metadata_sync";
|
||||
|
@ -144,9 +141,6 @@ COMMIT;
|
|||
|
||||
\c - - - :worker_1_port
|
||||
SELECT count(*) > 0 FROM pg_dist_node;
|
||||
SELECT count(*) > 0 FROM pg_dist_shard;
|
||||
SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'distributed_table__' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = 'start_stop_metadata_sync');
|
||||
SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'reference_table__' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = 'start_stop_metadata_sync');
|
||||
|
||||
\c - - - :master_port
|
||||
-- test synchronization for pg_dist_node flags
|
||||
|
@ -209,9 +203,6 @@ COMMIT;
|
|||
|
||||
\c - - - :worker_1_port
|
||||
SELECT count(*) > 0 FROM pg_dist_node;
|
||||
SELECT count(*) > 0 FROM pg_dist_shard;
|
||||
SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'distributed_table__' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = 'start_stop_metadata_sync');
|
||||
SELECT count(*) > 0 FROM pg_class WHERE relname LIKE 'reference_table__' AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = 'start_stop_metadata_sync');
|
||||
|
||||
\c - - - :master_port
|
||||
SET search_path TO "start_stop_metadata_sync";
|
||||
|
|
Loading…
Reference in New Issue