|
|
@ -78,10 +78,6 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
@ -89,7 +85,7 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
TRUNCATE pg_dist_node CASCADE
|
|
|
|
TRUNCATE pg_dist_node CASCADE
|
|
|
|
UPDATE pg_dist_local_group SET groupid = 1
|
|
|
|
UPDATE pg_dist_local_group SET groupid = 1
|
|
|
|
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid) AS (VALUES ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int) FROM distributed_object_data;
|
|
|
|
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid) AS (VALUES ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int) FROM distributed_object_data;
|
|
|
|
(30 rows)
|
|
|
|
(26 rows)
|
|
|
|
|
|
|
|
|
|
|
|
-- this function is dropped in Citus10, added here for tests
|
|
|
|
-- this function is dropped in Citus10, added here for tests
|
|
|
|
CREATE OR REPLACE FUNCTION pg_catalog.master_create_distributed_table(table_name regclass,
|
|
|
|
CREATE OR REPLACE FUNCTION pg_catalog.master_create_distributed_table(table_name regclass,
|
|
|
@ -151,10 +147,6 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
@ -164,7 +156,7 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0), ('sequence', ARRAY['public', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0), ('table', ARRAY['public', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int) FROM distributed_object_data;
|
|
|
|
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0), ('sequence', ARRAY['public', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0), ('table', ARRAY['public', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int) FROM distributed_object_data;
|
|
|
|
WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310000, 1, 0, 1, 100000), (1310001, 1, 0, 2, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 2, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 2, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 2, 100007)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data;
|
|
|
|
WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310000, 1, 0, 1, 100000), (1310001, 1, 0, 2, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 2, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 2, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 2, 100007)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('public.mx_test_table'::regclass, 1310000, 't'::"char", '-2147483648', '-1610612737'), ('public.mx_test_table'::regclass, 1310001, 't'::"char", '-1610612736', '-1073741825'), ('public.mx_test_table'::regclass, 1310002, 't'::"char", '-1073741824', '-536870913'), ('public.mx_test_table'::regclass, 1310003, 't'::"char", '-536870912', '-1'), ('public.mx_test_table'::regclass, 1310004, 't'::"char", '0', '536870911'), ('public.mx_test_table'::regclass, 1310005, 't'::"char", '536870912', '1073741823'), ('public.mx_test_table'::regclass, 1310006, 't'::"char", '1073741824', '1610612735'), ('public.mx_test_table'::regclass, 1310007, 't'::"char", '1610612736', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('public.mx_test_table'::regclass, 1310000, 't'::"char", '-2147483648', '-1610612737'), ('public.mx_test_table'::regclass, 1310001, 't'::"char", '-1610612736', '-1073741825'), ('public.mx_test_table'::regclass, 1310002, 't'::"char", '-1073741824', '-536870913'), ('public.mx_test_table'::regclass, 1310003, 't'::"char", '-536870912', '-1'), ('public.mx_test_table'::regclass, 1310004, 't'::"char", '0', '536870911'), ('public.mx_test_table'::regclass, 1310005, 't'::"char", '536870912', '1073741823'), ('public.mx_test_table'::regclass, 1310006, 't'::"char", '1073741824', '1610612735'), ('public.mx_test_table'::regclass, 1310007, 't'::"char", '1610612736', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
(42 rows)
|
|
|
|
(38 rows)
|
|
|
|
|
|
|
|
|
|
|
|
-- Show that CREATE INDEX commands are included in the activate node snapshot
|
|
|
|
-- Show that CREATE INDEX commands are included in the activate node snapshot
|
|
|
|
CREATE INDEX mx_index ON mx_test_table(col_2);
|
|
|
|
CREATE INDEX mx_index ON mx_test_table(col_2);
|
|
|
@ -201,10 +193,6 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
@ -214,7 +202,7 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0), ('sequence', ARRAY['public', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0), ('table', ARRAY['public', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int) FROM distributed_object_data;
|
|
|
|
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0), ('sequence', ARRAY['public', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0), ('table', ARRAY['public', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int) FROM distributed_object_data;
|
|
|
|
WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310000, 1, 0, 1, 100000), (1310001, 1, 0, 2, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 2, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 2, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 2, 100007)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data;
|
|
|
|
WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310000, 1, 0, 1, 100000), (1310001, 1, 0, 2, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 2, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 2, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 2, 100007)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('public.mx_test_table'::regclass, 1310000, 't'::"char", '-2147483648', '-1610612737'), ('public.mx_test_table'::regclass, 1310001, 't'::"char", '-1610612736', '-1073741825'), ('public.mx_test_table'::regclass, 1310002, 't'::"char", '-1073741824', '-536870913'), ('public.mx_test_table'::regclass, 1310003, 't'::"char", '-536870912', '-1'), ('public.mx_test_table'::regclass, 1310004, 't'::"char", '0', '536870911'), ('public.mx_test_table'::regclass, 1310005, 't'::"char", '536870912', '1073741823'), ('public.mx_test_table'::regclass, 1310006, 't'::"char", '1073741824', '1610612735'), ('public.mx_test_table'::regclass, 1310007, 't'::"char", '1610612736', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('public.mx_test_table'::regclass, 1310000, 't'::"char", '-2147483648', '-1610612737'), ('public.mx_test_table'::regclass, 1310001, 't'::"char", '-1610612736', '-1073741825'), ('public.mx_test_table'::regclass, 1310002, 't'::"char", '-1073741824', '-536870913'), ('public.mx_test_table'::regclass, 1310003, 't'::"char", '-536870912', '-1'), ('public.mx_test_table'::regclass, 1310004, 't'::"char", '0', '536870911'), ('public.mx_test_table'::regclass, 1310005, 't'::"char", '536870912', '1073741823'), ('public.mx_test_table'::regclass, 1310006, 't'::"char", '1073741824', '1610612735'), ('public.mx_test_table'::regclass, 1310007, 't'::"char", '1610612736', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
(43 rows)
|
|
|
|
(39 rows)
|
|
|
|
|
|
|
|
|
|
|
|
-- Show that schema changes are included in the activate node snapshot
|
|
|
|
-- Show that schema changes are included in the activate node snapshot
|
|
|
|
CREATE SCHEMA mx_testing_schema;
|
|
|
|
CREATE SCHEMA mx_testing_schema;
|
|
|
@ -253,10 +241,6 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
@ -266,7 +250,7 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0), ('sequence', ARRAY['mx_testing_schema', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0), ('table', ARRAY['mx_testing_schema', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['mx_testing_schema']::text[], ARRAY[]::text[], -1, 0)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int) FROM distributed_object_data;
|
|
|
|
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0), ('sequence', ARRAY['mx_testing_schema', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0), ('table', ARRAY['mx_testing_schema', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['mx_testing_schema']::text[], ARRAY[]::text[], -1, 0)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int) FROM distributed_object_data;
|
|
|
|
WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310000, 1, 0, 1, 100000), (1310001, 1, 0, 2, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 2, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 2, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 2, 100007)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data;
|
|
|
|
WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310000, 1, 0, 1, 100000), (1310001, 1, 0, 2, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 2, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 2, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 2, 100007)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('mx_testing_schema.mx_test_table'::regclass, 1310000, 't'::"char", '-2147483648', '-1610612737'), ('mx_testing_schema.mx_test_table'::regclass, 1310001, 't'::"char", '-1610612736', '-1073741825'), ('mx_testing_schema.mx_test_table'::regclass, 1310002, 't'::"char", '-1073741824', '-536870913'), ('mx_testing_schema.mx_test_table'::regclass, 1310003, 't'::"char", '-536870912', '-1'), ('mx_testing_schema.mx_test_table'::regclass, 1310004, 't'::"char", '0', '536870911'), ('mx_testing_schema.mx_test_table'::regclass, 1310005, 't'::"char", '536870912', '1073741823'), ('mx_testing_schema.mx_test_table'::regclass, 1310006, 't'::"char", '1073741824', '1610612735'), ('mx_testing_schema.mx_test_table'::regclass, 1310007, 't'::"char", '1610612736', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('mx_testing_schema.mx_test_table'::regclass, 1310000, 't'::"char", '-2147483648', '-1610612737'), ('mx_testing_schema.mx_test_table'::regclass, 1310001, 't'::"char", '-1610612736', '-1073741825'), ('mx_testing_schema.mx_test_table'::regclass, 1310002, 't'::"char", '-1073741824', '-536870913'), ('mx_testing_schema.mx_test_table'::regclass, 1310003, 't'::"char", '-536870912', '-1'), ('mx_testing_schema.mx_test_table'::regclass, 1310004, 't'::"char", '0', '536870911'), ('mx_testing_schema.mx_test_table'::regclass, 1310005, 't'::"char", '536870912', '1073741823'), ('mx_testing_schema.mx_test_table'::regclass, 1310006, 't'::"char", '1073741824', '1610612735'), ('mx_testing_schema.mx_test_table'::regclass, 1310007, 't'::"char", '1610612736', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
(44 rows)
|
|
|
|
(40 rows)
|
|
|
|
|
|
|
|
|
|
|
|
-- Show that append distributed tables are not included in the activate node snapshot
|
|
|
|
-- Show that append distributed tables are not included in the activate node snapshot
|
|
|
|
CREATE TABLE non_mx_test_table (col_1 int, col_2 text);
|
|
|
|
CREATE TABLE non_mx_test_table (col_1 int, col_2 text);
|
|
|
@ -311,10 +295,6 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
@ -324,7 +304,7 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0), ('sequence', ARRAY['mx_testing_schema', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0), ('table', ARRAY['mx_testing_schema', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['mx_testing_schema']::text[], ARRAY[]::text[], -1, 0)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int) FROM distributed_object_data;
|
|
|
|
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0), ('sequence', ARRAY['mx_testing_schema', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0), ('table', ARRAY['mx_testing_schema', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['mx_testing_schema']::text[], ARRAY[]::text[], -1, 0)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int) FROM distributed_object_data;
|
|
|
|
WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310000, 1, 0, 1, 100000), (1310001, 1, 0, 2, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 2, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 2, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 2, 100007)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data;
|
|
|
|
WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310000, 1, 0, 1, 100000), (1310001, 1, 0, 2, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 2, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 2, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 2, 100007)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('mx_testing_schema.mx_test_table'::regclass, 1310000, 't'::"char", '-2147483648', '-1610612737'), ('mx_testing_schema.mx_test_table'::regclass, 1310001, 't'::"char", '-1610612736', '-1073741825'), ('mx_testing_schema.mx_test_table'::regclass, 1310002, 't'::"char", '-1073741824', '-536870913'), ('mx_testing_schema.mx_test_table'::regclass, 1310003, 't'::"char", '-536870912', '-1'), ('mx_testing_schema.mx_test_table'::regclass, 1310004, 't'::"char", '0', '536870911'), ('mx_testing_schema.mx_test_table'::regclass, 1310005, 't'::"char", '536870912', '1073741823'), ('mx_testing_schema.mx_test_table'::regclass, 1310006, 't'::"char", '1073741824', '1610612735'), ('mx_testing_schema.mx_test_table'::regclass, 1310007, 't'::"char", '1610612736', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('mx_testing_schema.mx_test_table'::regclass, 1310000, 't'::"char", '-2147483648', '-1610612737'), ('mx_testing_schema.mx_test_table'::regclass, 1310001, 't'::"char", '-1610612736', '-1073741825'), ('mx_testing_schema.mx_test_table'::regclass, 1310002, 't'::"char", '-1073741824', '-536870913'), ('mx_testing_schema.mx_test_table'::regclass, 1310003, 't'::"char", '-536870912', '-1'), ('mx_testing_schema.mx_test_table'::regclass, 1310004, 't'::"char", '0', '536870911'), ('mx_testing_schema.mx_test_table'::regclass, 1310005, 't'::"char", '536870912', '1073741823'), ('mx_testing_schema.mx_test_table'::regclass, 1310006, 't'::"char", '1073741824', '1610612735'), ('mx_testing_schema.mx_test_table'::regclass, 1310007, 't'::"char", '1610612736', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
(44 rows)
|
|
|
|
(40 rows)
|
|
|
|
|
|
|
|
|
|
|
|
-- Show that range distributed tables are not included in the activate node snapshot
|
|
|
|
-- Show that range distributed tables are not included in the activate node snapshot
|
|
|
|
UPDATE pg_dist_partition SET partmethod='r' WHERE logicalrelid='non_mx_test_table'::regclass;
|
|
|
|
UPDATE pg_dist_partition SET partmethod='r' WHERE logicalrelid='non_mx_test_table'::regclass;
|
|
|
@ -362,10 +342,6 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
@ -375,7 +351,7 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0), ('sequence', ARRAY['mx_testing_schema', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0), ('table', ARRAY['mx_testing_schema', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['mx_testing_schema']::text[], ARRAY[]::text[], -1, 0)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int) FROM distributed_object_data;
|
|
|
|
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0), ('sequence', ARRAY['mx_testing_schema', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0), ('table', ARRAY['mx_testing_schema', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0), ('schema', ARRAY['mx_testing_schema']::text[], ARRAY[]::text[], -1, 0)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int) FROM distributed_object_data;
|
|
|
|
WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310000, 1, 0, 1, 100000), (1310001, 1, 0, 2, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 2, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 2, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 2, 100007)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data;
|
|
|
|
WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310000, 1, 0, 1, 100000), (1310001, 1, 0, 2, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 2, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 2, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 2, 100007)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('mx_testing_schema.mx_test_table'::regclass, 1310000, 't'::"char", '-2147483648', '-1610612737'), ('mx_testing_schema.mx_test_table'::regclass, 1310001, 't'::"char", '-1610612736', '-1073741825'), ('mx_testing_schema.mx_test_table'::regclass, 1310002, 't'::"char", '-1073741824', '-536870913'), ('mx_testing_schema.mx_test_table'::regclass, 1310003, 't'::"char", '-536870912', '-1'), ('mx_testing_schema.mx_test_table'::regclass, 1310004, 't'::"char", '0', '536870911'), ('mx_testing_schema.mx_test_table'::regclass, 1310005, 't'::"char", '536870912', '1073741823'), ('mx_testing_schema.mx_test_table'::regclass, 1310006, 't'::"char", '1073741824', '1610612735'), ('mx_testing_schema.mx_test_table'::regclass, 1310007, 't'::"char", '1610612736', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('mx_testing_schema.mx_test_table'::regclass, 1310000, 't'::"char", '-2147483648', '-1610612737'), ('mx_testing_schema.mx_test_table'::regclass, 1310001, 't'::"char", '-1610612736', '-1073741825'), ('mx_testing_schema.mx_test_table'::regclass, 1310002, 't'::"char", '-1073741824', '-536870913'), ('mx_testing_schema.mx_test_table'::regclass, 1310003, 't'::"char", '-536870912', '-1'), ('mx_testing_schema.mx_test_table'::regclass, 1310004, 't'::"char", '0', '536870911'), ('mx_testing_schema.mx_test_table'::regclass, 1310005, 't'::"char", '536870912', '1073741823'), ('mx_testing_schema.mx_test_table'::regclass, 1310006, 't'::"char", '1073741824', '1610612735'), ('mx_testing_schema.mx_test_table'::regclass, 1310007, 't'::"char", '1610612736', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
(44 rows)
|
|
|
|
(40 rows)
|
|
|
|
|
|
|
|
|
|
|
|
-- Test start_metadata_sync_to_node and citus_activate_node UDFs
|
|
|
|
-- Test start_metadata_sync_to_node and citus_activate_node UDFs
|
|
|
|
-- Ensure that hasmetadata=false for all nodes
|
|
|
|
-- Ensure that hasmetadata=false for all nodes
|
|
|
@ -1903,10 +1879,6 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'off'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
|
SET citus.enable_ddl_propagation TO 'on'
|
|
|
@ -1926,7 +1898,7 @@ SELECT unnest(activate_node_snapshot()) order by 1;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('public.dist_table_1'::regclass, 1310074, 't'::"char", '-2147483648', '-1073741825'), ('public.dist_table_1'::regclass, 1310075, 't'::"char", '-1073741824', '-1'), ('public.dist_table_1'::regclass, 1310076, 't'::"char", '0', '1073741823'), ('public.dist_table_1'::regclass, 1310077, 't'::"char", '1073741824', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('public.dist_table_1'::regclass, 1310074, 't'::"char", '-2147483648', '-1073741825'), ('public.dist_table_1'::regclass, 1310075, 't'::"char", '-1073741824', '-1'), ('public.dist_table_1'::regclass, 1310076, 't'::"char", '0', '1073741823'), ('public.dist_table_1'::regclass, 1310077, 't'::"char", '1073741824', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('public.mx_ref'::regclass, 1310073, 't'::"char", NULL, NULL)) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('public.mx_ref'::regclass, 1310073, 't'::"char", NULL, NULL)) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('public.test_table'::regclass, 1310083, 't'::"char", '-2147483648', '-1073741825'), ('public.test_table'::regclass, 1310084, 't'::"char", '-1073741824', '-1'), ('public.test_table'::regclass, 1310085, 't'::"char", '0', '1073741823'), ('public.test_table'::regclass, 1310086, 't'::"char", '1073741824', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('public.test_table'::regclass, 1310083, 't'::"char", '-2147483648', '-1073741825'), ('public.test_table'::regclass, 1310084, 't'::"char", '-1073741824', '-1'), ('public.test_table'::regclass, 1310085, 't'::"char", '0', '1073741823'), ('public.test_table'::regclass, 1310086, 't'::"char", '1073741824', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
|
|
|
|
(87 rows)
|
|
|
|
(83 rows)
|
|
|
|
|
|
|
|
|
|
|
|
-- shouldn't work since test_table is MX
|
|
|
|
-- shouldn't work since test_table is MX
|
|
|
|
ALTER TABLE test_table ADD COLUMN id3 bigserial;
|
|
|
|
ALTER TABLE test_table ADD COLUMN id3 bigserial;
|
|
|
|