mirror of https://github.com/citusdata/citus.git
Merge pull request #5503 from citusdata/fix_undist_table_test_metadata_sync_fails
Fix fails with metadata syncing in undistribute_tablepull/5506/head
commit
ae134c209f
|
@ -130,6 +130,16 @@ HINT: Use cascade option to undistribute all the relations involved in a foreig
|
||||||
DROP TABLE referenced_table, referencing_table;
|
DROP TABLE referenced_table, referencing_table;
|
||||||
-- test distributed foreign tables
|
-- test distributed foreign tables
|
||||||
-- we expect errors
|
-- we expect errors
|
||||||
|
-- and we need metadata sync off for foreign tables
|
||||||
|
SELECT stop_metadata_sync_to_node(nodename, nodeport) FROM pg_dist_node WHERE isactive = 't' and noderole = 'primary';
|
||||||
|
NOTICE: dropping metadata on the node (localhost,57638)
|
||||||
|
NOTICE: dropping metadata on the node (localhost,57637)
|
||||||
|
stop_metadata_sync_to_node
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
(2 rows)
|
||||||
|
|
||||||
CREATE FOREIGN TABLE foreign_table (
|
CREATE FOREIGN TABLE foreign_table (
|
||||||
id bigint not null,
|
id bigint not null,
|
||||||
full_name text not null default ''
|
full_name text not null default ''
|
||||||
|
@ -145,6 +155,13 @@ NOTICE: foreign-data wrapper "fake_fdw" does not have an extension defined
|
||||||
SELECT undistribute_table('foreign_table');
|
SELECT undistribute_table('foreign_table');
|
||||||
ERROR: cannot complete operation because it is a foreign table
|
ERROR: cannot complete operation because it is a foreign table
|
||||||
DROP FOREIGN TABLE foreign_table;
|
DROP FOREIGN TABLE foreign_table;
|
||||||
|
SELECT start_metadata_sync_to_node(nodename, nodeport) FROM pg_dist_node WHERE isactive = 't' and noderole = 'primary';
|
||||||
|
start_metadata_sync_to_node
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
(2 rows)
|
||||||
|
|
||||||
-- test partitioned tables
|
-- test partitioned tables
|
||||||
CREATE TABLE partitioned_table (id INT, a INT) PARTITION BY RANGE (id);
|
CREATE TABLE partitioned_table (id INT, a INT) PARTITION BY RANGE (id);
|
||||||
CREATE TABLE partitioned_table_1_5 PARTITION OF partitioned_table FOR VALUES FROM (1) TO (5);
|
CREATE TABLE partitioned_table_1_5 PARTITION OF partitioned_table FOR VALUES FROM (1) TO (5);
|
||||||
|
@ -164,7 +181,7 @@ SELECT logicalrelid FROM pg_dist_partition WHERE logicalrelid::regclass::text LI
|
||||||
partitioned_table_6_10
|
partitioned_table_6_10
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
SELECT run_command_on_workers($$SELECT COUNT(*) FROM pg_catalog.pg_class WHERE relname LIKE 'partitioned\_table%'$$);
|
SELECT run_command_on_workers($$SELECT COUNT(*) FROM pg_catalog.pg_class WHERE relname SIMILAR TO 'partitioned\_table%\d{3,}'$$);
|
||||||
run_command_on_workers
|
run_command_on_workers
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,t,6)
|
(localhost,57637,t,6)
|
||||||
|
@ -225,7 +242,7 @@ SELECT logicalrelid FROM pg_dist_partition WHERE logicalrelid::regclass::text LI
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(0 rows)
|
(0 rows)
|
||||||
|
|
||||||
SELECT run_command_on_workers($$SELECT COUNT(*) FROM pg_catalog.pg_class WHERE relname LIKE 'partitioned\_table%'$$);
|
SELECT run_command_on_workers($$SELECT COUNT(*) FROM pg_catalog.pg_class WHERE relname SIMILAR TO 'partitioned\_table%\d{3,}'$$);
|
||||||
run_command_on_workers
|
run_command_on_workers
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,t,0)
|
(localhost,57637,t,0)
|
||||||
|
|
|
@ -58,12 +58,6 @@ test: pg13 pg12
|
||||||
test: pg14
|
test: pg14
|
||||||
test: tableam drop_column_partitioned_table
|
test: tableam drop_column_partitioned_table
|
||||||
|
|
||||||
# mx-less tests
|
|
||||||
test: check_mx
|
|
||||||
test: turn_mx_off
|
|
||||||
test: undistribute_table
|
|
||||||
test: turn_mx_on
|
|
||||||
|
|
||||||
# ----------
|
# ----------
|
||||||
# Miscellaneous tests to check our query planning behavior
|
# Miscellaneous tests to check our query planning behavior
|
||||||
# ----------
|
# ----------
|
||||||
|
@ -97,6 +91,7 @@ test: alter_table_set_access_method
|
||||||
test: alter_distributed_table
|
test: alter_distributed_table
|
||||||
test: issue_5248 issue_5099
|
test: issue_5248 issue_5099
|
||||||
test: object_propagation_debug
|
test: object_propagation_debug
|
||||||
|
test: undistribute_table
|
||||||
|
|
||||||
|
|
||||||
# ---------
|
# ---------
|
||||||
|
|
|
@ -54,6 +54,8 @@ DROP TABLE referenced_table, referencing_table;
|
||||||
|
|
||||||
-- test distributed foreign tables
|
-- test distributed foreign tables
|
||||||
-- we expect errors
|
-- we expect errors
|
||||||
|
-- and we need metadata sync off for foreign tables
|
||||||
|
SELECT stop_metadata_sync_to_node(nodename, nodeport) FROM pg_dist_node WHERE isactive = 't' and noderole = 'primary';
|
||||||
CREATE FOREIGN TABLE foreign_table (
|
CREATE FOREIGN TABLE foreign_table (
|
||||||
id bigint not null,
|
id bigint not null,
|
||||||
full_name text not null default ''
|
full_name text not null default ''
|
||||||
|
@ -62,6 +64,7 @@ SELECT create_distributed_table('foreign_table', 'id');
|
||||||
SELECT undistribute_table('foreign_table');
|
SELECT undistribute_table('foreign_table');
|
||||||
|
|
||||||
DROP FOREIGN TABLE foreign_table;
|
DROP FOREIGN TABLE foreign_table;
|
||||||
|
SELECT start_metadata_sync_to_node(nodename, nodeport) FROM pg_dist_node WHERE isactive = 't' and noderole = 'primary';
|
||||||
|
|
||||||
-- test partitioned tables
|
-- test partitioned tables
|
||||||
CREATE TABLE partitioned_table (id INT, a INT) PARTITION BY RANGE (id);
|
CREATE TABLE partitioned_table (id INT, a INT) PARTITION BY RANGE (id);
|
||||||
|
@ -71,7 +74,7 @@ SELECT create_distributed_table('partitioned_table', 'id');
|
||||||
INSERT INTO partitioned_table VALUES (2, 12), (7, 2);
|
INSERT INTO partitioned_table VALUES (2, 12), (7, 2);
|
||||||
|
|
||||||
SELECT logicalrelid FROM pg_dist_partition WHERE logicalrelid::regclass::text LIKE 'partitioned\_table%' ORDER BY 1;
|
SELECT logicalrelid FROM pg_dist_partition WHERE logicalrelid::regclass::text LIKE 'partitioned\_table%' ORDER BY 1;
|
||||||
SELECT run_command_on_workers($$SELECT COUNT(*) FROM pg_catalog.pg_class WHERE relname LIKE 'partitioned\_table%'$$);
|
SELECT run_command_on_workers($$SELECT COUNT(*) FROM pg_catalog.pg_class WHERE relname SIMILAR TO 'partitioned\_table%\d{3,}'$$);
|
||||||
SELECT inhrelid::regclass FROM pg_catalog.pg_inherits WHERE inhparent = 'partitioned_table'::regclass ORDER BY 1;
|
SELECT inhrelid::regclass FROM pg_catalog.pg_inherits WHERE inhparent = 'partitioned_table'::regclass ORDER BY 1;
|
||||||
SELECT * FROM partitioned_table ORDER BY 1, 2;
|
SELECT * FROM partitioned_table ORDER BY 1, 2;
|
||||||
SELECT * FROM partitioned_table_1_5 ORDER BY 1, 2;
|
SELECT * FROM partitioned_table_1_5 ORDER BY 1, 2;
|
||||||
|
@ -83,7 +86,7 @@ SELECT undistribute_table('partitioned_table_1_5');
|
||||||
SELECT undistribute_table('partitioned_table');
|
SELECT undistribute_table('partitioned_table');
|
||||||
|
|
||||||
SELECT logicalrelid FROM pg_dist_partition WHERE logicalrelid::regclass::text LIKE 'partitioned\_table%' ORDER BY 1;
|
SELECT logicalrelid FROM pg_dist_partition WHERE logicalrelid::regclass::text LIKE 'partitioned\_table%' ORDER BY 1;
|
||||||
SELECT run_command_on_workers($$SELECT COUNT(*) FROM pg_catalog.pg_class WHERE relname LIKE 'partitioned\_table%'$$);
|
SELECT run_command_on_workers($$SELECT COUNT(*) FROM pg_catalog.pg_class WHERE relname SIMILAR TO 'partitioned\_table%\d{3,}'$$);
|
||||||
SELECT inhrelid::regclass FROM pg_catalog.pg_inherits WHERE inhparent = 'partitioned_table'::regclass ORDER BY 1;
|
SELECT inhrelid::regclass FROM pg_catalog.pg_inherits WHERE inhparent = 'partitioned_table'::regclass ORDER BY 1;
|
||||||
SELECT * FROM partitioned_table ORDER BY 1, 2;
|
SELECT * FROM partitioned_table ORDER BY 1, 2;
|
||||||
SELECT * FROM partitioned_table_1_5 ORDER BY 1, 2;
|
SELECT * FROM partitioned_table_1_5 ORDER BY 1, 2;
|
||||||
|
|
Loading…
Reference in New Issue