Fix tests

new-record-failure-dnm
Halil Ozan Akgul 2022-04-18 18:15:37 +03:00
parent 740dce9817
commit 4a3c978483
6 changed files with 69 additions and 43 deletions

View File

@ -368,6 +368,8 @@ NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.pa
NOTICE: issuing DROP TABLE IF EXISTS drop_partitioned_table.parent_xxxxx CASCADE NOTICE: issuing DROP TABLE IF EXISTS drop_partitioned_table.parent_xxxxx CASCADE
NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.child1') NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.child1')
NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.child1') NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.child1')
NOTICE: issuing SELECT pg_catalog.citus_internal_delete_colocation_metadata(100046)
NOTICE: issuing SELECT pg_catalog.citus_internal_delete_colocation_metadata(100046)
ROLLBACK; ROLLBACK;
NOTICE: issuing ROLLBACK NOTICE: issuing ROLLBACK
NOTICE: issuing ROLLBACK NOTICE: issuing ROLLBACK
@ -389,6 +391,8 @@ NOTICE: issuing DROP TABLE IF EXISTS drop_partitioned_table.parent_xxxxx CASCAD
NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.child1') NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.child1')
NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.child1') NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.child1')
NOTICE: issuing DROP TABLE IF EXISTS drop_partitioned_table.child1_xxxxx CASCADE NOTICE: issuing DROP TABLE IF EXISTS drop_partitioned_table.child1_xxxxx CASCADE
NOTICE: issuing SELECT pg_catalog.citus_internal_delete_colocation_metadata(100046)
NOTICE: issuing SELECT pg_catalog.citus_internal_delete_colocation_metadata(100046)
ROLLBACK; ROLLBACK;
NOTICE: issuing ROLLBACK NOTICE: issuing ROLLBACK
NOTICE: issuing ROLLBACK NOTICE: issuing ROLLBACK

View File

@ -1119,7 +1119,7 @@ SELECT create_distributed_function('func_to_colocate(int)', colocate_with:='tbl_
SELECT distribution_argument_index, colocationid, force_delegation FROM pg_catalog.pg_dist_object WHERE objid = 'func_to_colocate'::regproc; SELECT distribution_argument_index, colocationid, force_delegation FROM pg_catalog.pg_dist_object WHERE objid = 'func_to_colocate'::regproc;
distribution_argument_index | colocationid | force_delegation distribution_argument_index | colocationid | force_delegation
--------------------------------------------------------------------- ---------------------------------------------------------------------
| 10003 | | 161 |
(1 row) (1 row)
-- convert to non-delegated -- convert to non-delegated
@ -1147,7 +1147,7 @@ SELECT create_distributed_function('func_to_colocate(int)','$1','tbl_to_colocate
SELECT distribution_argument_index, colocationid, force_delegation FROM pg_catalog.pg_dist_object WHERE objid = 'func_to_colocate'::regproc; SELECT distribution_argument_index, colocationid, force_delegation FROM pg_catalog.pg_dist_object WHERE objid = 'func_to_colocate'::regproc;
distribution_argument_index | colocationid | force_delegation distribution_argument_index | colocationid | force_delegation
--------------------------------------------------------------------- ---------------------------------------------------------------------
0 | 10005 | 0 | 162 |
(1 row) (1 row)
-- try create or replace the same func -- try create or replace the same func
@ -1156,7 +1156,7 @@ CREATE OR REPLACE FUNCTION func_to_colocate (a int) returns int as $$select 1;$$
SELECT distribution_argument_index, colocationid, force_delegation FROM pg_catalog.pg_dist_object WHERE objid = 'func_to_colocate'::regproc; SELECT distribution_argument_index, colocationid, force_delegation FROM pg_catalog.pg_dist_object WHERE objid = 'func_to_colocate'::regproc;
distribution_argument_index | colocationid | force_delegation distribution_argument_index | colocationid | force_delegation
--------------------------------------------------------------------- ---------------------------------------------------------------------
0 | 10005 | 0 | 162 |
(1 row) (1 row)
-- convert to non-delegated -- convert to non-delegated
@ -1184,7 +1184,7 @@ SELECT create_distributed_function('func_to_colocate(int)','$1','tbl_to_colocate
SELECT distribution_argument_index, colocationid, force_delegation FROM pg_catalog.pg_dist_object WHERE objid = 'func_to_colocate'::regproc; SELECT distribution_argument_index, colocationid, force_delegation FROM pg_catalog.pg_dist_object WHERE objid = 'func_to_colocate'::regproc;
distribution_argument_index | colocationid | force_delegation distribution_argument_index | colocationid | force_delegation
--------------------------------------------------------------------- ---------------------------------------------------------------------
0 | 10005 | t 0 | 162 | t
(1 row) (1 row)
-- convert to non-delegated -- convert to non-delegated

View File

@ -451,7 +451,8 @@ SELECT * FROM pg_dist_colocation
5 | 2 | 1 | 23 | 0 5 | 2 | 1 | 23 | 0
6 | 2 | 2 | 25 | 100 6 | 2 | 2 | 25 | 100
7 | 8 | 2 | 23 | 0 7 | 8 | 2 | 23 | 0
(4 rows) 21 | 1 | -1 | 0 | 0
(5 rows)
-- check to see whether metadata is synced -- check to see whether metadata is synced
SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$ SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$
@ -464,11 +465,13 @@ $$);
57637 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 1, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 1, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57637 | {"shardcount": 2, "colocationid": 6, "replicationfactor": 2, "distributioncolumntype": "25", "distributioncolumncollation": "100"} 57637 | {"shardcount": 2, "colocationid": 6, "replicationfactor": 2, "distributioncolumntype": "25", "distributioncolumncollation": "100"}
57637 | {"shardcount": 8, "colocationid": 7, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 8, "colocationid": 7, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57637 | {"shardcount": 1, "colocationid": 21, "replicationfactor": -1, "distributioncolumntype": "0", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 1, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 1, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 6, "replicationfactor": 2, "distributioncolumntype": "25", "distributioncolumncollation": "100"} 57638 | {"shardcount": 2, "colocationid": 6, "replicationfactor": 2, "distributioncolumntype": "25", "distributioncolumncollation": "100"}
57638 | {"shardcount": 8, "colocationid": 7, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 8, "colocationid": 7, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
(8 rows) 57638 | {"shardcount": 1, "colocationid": 21, "replicationfactor": -1, "distributioncolumntype": "0", "distributioncolumncollation": "0"}
(10 rows)
SELECT logicalrelid, colocationid FROM pg_dist_partition SELECT logicalrelid, colocationid FROM pg_dist_partition
WHERE colocationid >= 1 AND colocationid < 1000 WHERE colocationid >= 1 AND colocationid < 1000
@ -508,18 +511,15 @@ DROP TABLE table2_groupA;
SELECT * FROM pg_dist_colocation WHERE colocationid = 4; SELECT * FROM pg_dist_colocation WHERE colocationid = 4;
colocationid | shardcount | replicationfactor | distributioncolumntype | distributioncolumncollation colocationid | shardcount | replicationfactor | distributioncolumntype | distributioncolumncollation
--------------------------------------------------------------------- ---------------------------------------------------------------------
4 | 2 | 2 | 23 | 0 (0 rows)
(1 row)
-- check to see whether metadata is synced -- check to see whether metadata is synced
SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$ SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$
SELECT array_agg(row_to_json(c)) FROM pg_dist_colocation c WHERE colocationid = 4 SELECT coalesce(array_agg(row_to_json(c)), '{}') FROM pg_dist_colocation c WHERE colocationid = 4
$$); $$);
nodeport | unnest nodeport | unnest
--------------------------------------------------------------------- ---------------------------------------------------------------------
57637 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} (0 rows)
57638 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
(2 rows)
-- create dropped colocation group again -- create dropped colocation group again
SET citus.shard_count = 2; SET citus.shard_count = 2;
@ -606,33 +606,36 @@ SELECT * FROM pg_dist_colocation
ORDER BY colocationid; ORDER BY colocationid;
colocationid | shardcount | replicationfactor | distributioncolumntype | distributioncolumncollation colocationid | shardcount | replicationfactor | distributioncolumntype | distributioncolumncollation
--------------------------------------------------------------------- ---------------------------------------------------------------------
4 | 2 | 2 | 23 | 0
5 | 2 | 1 | 23 | 0 5 | 2 | 1 | 23 | 0
6 | 2 | 2 | 25 | 100 6 | 2 | 2 | 25 | 100
7 | 8 | 2 | 23 | 0 7 | 8 | 2 | 23 | 0
8 | 2 | 2 | 23 | 0
9 | 2 | 2 | 23 | 0
10 | 2 | 2 | 23 | 0
11 | 3 | 2 | 23 | 0 11 | 3 | 2 | 23 | 0
(5 rows) 21 | 1 | -1 | 0 | 0
(8 rows)
SELECT logicalrelid, colocationid FROM pg_dist_partition SELECT logicalrelid, colocationid FROM pg_dist_partition
WHERE colocationid >= 1 AND colocationid < 1000 WHERE colocationid >= 1 AND colocationid < 1000
ORDER BY colocationid, logicalrelid; ORDER BY colocationid, logicalrelid;
logicalrelid | colocationid logicalrelid | colocationid
--------------------------------------------------------------------- ---------------------------------------------------------------------
table1_groupe | 4
table2_groupe | 4
table3_groupe | 4
schema_colocation.table4_groupe | 4
table4_groupe | 4
table1_groupb | 5 table1_groupb | 5
table2_groupb | 5 table2_groupb | 5
table1_groupc | 6 table1_groupc | 6
table2_groupc | 6 table2_groupc | 6
table1_groupd | 7 table1_groupd | 7
table2_groupd | 7 table2_groupd | 7
table1_group_none_1 | 8 table1_groupe | 8
table2_group_none_1 | 8 table2_groupe | 8
table1_group_none_2 | 9 table3_groupe | 8
table1_group_none_3 | 10 schema_colocation.table4_groupe | 8
table4_groupe | 8
table1_group_none_1 | 9
table2_group_none_1 | 9
table1_group_none_2 | 10
table1_group_none_3 | 11
table1_group_default | 11 table1_group_default | 11
(16 rows) (16 rows)
@ -699,12 +702,15 @@ SELECT * FROM pg_dist_colocation
ORDER BY colocationid; ORDER BY colocationid;
colocationid | shardcount | replicationfactor | distributioncolumntype | distributioncolumncollation colocationid | shardcount | replicationfactor | distributioncolumntype | distributioncolumncollation
--------------------------------------------------------------------- ---------------------------------------------------------------------
4 | 2 | 2 | 23 | 0
5 | 2 | 1 | 23 | 0 5 | 2 | 1 | 23 | 0
6 | 2 | 2 | 25 | 100 6 | 2 | 2 | 25 | 100
7 | 8 | 2 | 23 | 0 7 | 8 | 2 | 23 | 0
8 | 2 | 2 | 23 | 0
9 | 2 | 2 | 23 | 0
10 | 2 | 2 | 23 | 0
11 | 3 | 2 | 23 | 0 11 | 3 | 2 | 23 | 0
(5 rows) 21 | 1 | -1 | 0 | 0
(8 rows)
-- cross check with internal colocation API -- cross check with internal colocation API
SELECT SELECT
@ -739,8 +745,9 @@ ORDER BY
table3_groupe | table4_groupe | t table3_groupe | table4_groupe | t
schema_colocation.table4_groupe | table4_groupe | t schema_colocation.table4_groupe | table4_groupe | t
table1_group_none_1 | table2_group_none_1 | t table1_group_none_1 | table2_group_none_1 | t
table1_group_none_3 | table1_group_default | t
table1_groupf | table2_groupf | t table1_groupf | table2_groupf | t
(16 rows) (17 rows)
-- check created shards -- check created shards
SELECT SELECT
@ -979,7 +986,10 @@ SELECT * FROM pg_dist_colocation
3 | 8 | 2 | 23 | 0 3 | 8 | 2 | 23 | 0
4 | 2 | 2 | 23 | 0 4 | 2 | 2 | 23 | 0
5 | 2 | 2 | 23 | 0 5 | 2 | 2 | 23 | 0
(5 rows) 6 | 2 | 2 | 23 | 0
7 | 1 | -1 | 0 | 0
8 | 2 | 2 | 23 | 0
(8 rows)
-- check to see whether metadata is synced -- check to see whether metadata is synced
SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$ SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$
@ -993,12 +1003,18 @@ $$);
57637 | {"shardcount": 8, "colocationid": 3, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 8, "colocationid": 3, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57637 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57637 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57637 | {"shardcount": 2, "colocationid": 6, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57637 | {"shardcount": 1, "colocationid": 7, "replicationfactor": -1, "distributioncolumntype": "0", "distributioncolumncollation": "0"}
57637 | {"shardcount": 2, "colocationid": 8, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 1, "replicationfactor": 1, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 1, "replicationfactor": 1, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 2, "replicationfactor": 2, "distributioncolumntype": "25", "distributioncolumncollation": "100"} 57638 | {"shardcount": 2, "colocationid": 2, "replicationfactor": 2, "distributioncolumntype": "25", "distributioncolumncollation": "100"}
57638 | {"shardcount": 8, "colocationid": 3, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 8, "colocationid": 3, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
(10 rows) 57638 | {"shardcount": 2, "colocationid": 6, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57638 | {"shardcount": 1, "colocationid": 7, "replicationfactor": -1, "distributioncolumntype": "0", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 8, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
(16 rows)
SELECT logicalrelid, colocationid FROM pg_dist_partition SELECT logicalrelid, colocationid FROM pg_dist_partition
WHERE colocationid >= 1 AND colocationid < 1000 WHERE colocationid >= 1 AND colocationid < 1000
@ -1015,7 +1031,7 @@ SELECT logicalrelid, colocationid FROM pg_dist_partition
table1_groupe | 5 table1_groupe | 5
table3_groupe | 5 table3_groupe | 5
table1_group_none | 6 table1_group_none | 6
table2_group_none | 7 table2_group_none | 8
(11 rows) (11 rows)
-- move the all tables in colocation group 5 to colocation group 7 -- move the all tables in colocation group 5 to colocation group 7
@ -1073,7 +1089,9 @@ SELECT * FROM pg_dist_colocation
3 | 8 | 2 | 23 | 0 3 | 8 | 2 | 23 | 0
4 | 2 | 2 | 23 | 0 4 | 2 | 2 | 23 | 0
5 | 2 | 2 | 23 | 0 5 | 2 | 2 | 23 | 0
(5 rows) 7 | 1 | -1 | 0 | 0
8 | 2 | 2 | 23 | 0
(7 rows)
-- check to see whether metadata is synced -- check to see whether metadata is synced
SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$ SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$
@ -1087,12 +1105,16 @@ $$);
57637 | {"shardcount": 8, "colocationid": 3, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 8, "colocationid": 3, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57637 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57637 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57637 | {"shardcount": 1, "colocationid": 7, "replicationfactor": -1, "distributioncolumntype": "0", "distributioncolumncollation": "0"}
57637 | {"shardcount": 2, "colocationid": 8, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 1, "replicationfactor": 1, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 1, "replicationfactor": 1, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 2, "replicationfactor": 2, "distributioncolumntype": "25", "distributioncolumncollation": "100"} 57638 | {"shardcount": 2, "colocationid": 2, "replicationfactor": 2, "distributioncolumntype": "25", "distributioncolumncollation": "100"}
57638 | {"shardcount": 8, "colocationid": 3, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 8, "colocationid": 3, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
(10 rows) 57638 | {"shardcount": 1, "colocationid": 7, "replicationfactor": -1, "distributioncolumntype": "0", "distributioncolumncollation": "0"}
57638 | {"shardcount": 2, "colocationid": 8, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"}
(14 rows)
SELECT logicalrelid, colocationid FROM pg_dist_partition SELECT logicalrelid, colocationid FROM pg_dist_partition
WHERE colocationid >= 1 AND colocationid < 1000 WHERE colocationid >= 1 AND colocationid < 1000
@ -1108,8 +1130,8 @@ SELECT logicalrelid, colocationid FROM pg_dist_partition
table2_groupe | 4 table2_groupe | 4
table1_groupe | 5 table1_groupe | 5
table3_groupe | 5 table3_groupe | 5
table1_group_none | 7 table1_group_none | 8
table2_group_none | 7 table2_group_none | 8
(11 rows) (11 rows)
-- try to colocate different replication models -- try to colocate different replication models

View File

@ -678,9 +678,9 @@ NOTICE: issuing SET citus.enable_ddl_propagation TO 'off'
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing SET citus.enable_ddl_propagation TO 'off' NOTICE: issuing SET citus.enable_ddl_propagation TO 'off'
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing SELECT citus_internal_add_partition_metadata ('fix_idx_names.p2'::regclass, 'h', 'dist_col', 1370000, 's') NOTICE: issuing SELECT citus_internal_add_partition_metadata ('fix_idx_names.p2'::regclass, 'h', 'dist_col', 100050, 's')
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing SELECT citus_internal_add_partition_metadata ('fix_idx_names.p2'::regclass, 'h', 'dist_col', 1370000, 's') NOTICE: issuing SELECT citus_internal_add_partition_metadata ('fix_idx_names.p2'::regclass, 'h', 'dist_col', 100050, 's')
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('fix_idx_names.p2'::regclass, 915002, 't'::"char", '-2147483648', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data; NOTICE: issuing WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('fix_idx_names.p2'::regclass, 915002, 't'::"char", '-2147483648', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx

View File

@ -1895,12 +1895,12 @@ SELECT unnest(activate_node_snapshot()) order by 1;
RESET ROLE RESET ROLE
RESET ROLE RESET ROLE
SELECT alter_role_if_exists('postgres', 'ALTER ROLE postgres SET lc_messages = ''C''') SELECT alter_role_if_exists('postgres', 'ALTER ROLE postgres SET lc_messages = ''C''')
SELECT citus_internal_add_partition_metadata ('mx_test_schema_1.mx_table_1'::regclass, 'h', 'col1', 4, 's') SELECT citus_internal_add_partition_metadata ('mx_test_schema_1.mx_table_1'::regclass, 'h', 'col1', 5, 's')
SELECT citus_internal_add_partition_metadata ('mx_test_schema_2.mx_table_2'::regclass, 'h', 'col1', 4, 's') SELECT citus_internal_add_partition_metadata ('mx_test_schema_2.mx_table_2'::regclass, 'h', 'col1', 5, 's')
SELECT citus_internal_add_partition_metadata ('mx_testing_schema.mx_test_table'::regclass, 'h', 'col_1', 2, 's') SELECT citus_internal_add_partition_metadata ('mx_testing_schema.mx_test_table'::regclass, 'h', 'col_1', 2, 's')
SELECT citus_internal_add_partition_metadata ('public.dist_table_1'::regclass, 'h', 'a', 10005, 's') SELECT citus_internal_add_partition_metadata ('public.dist_table_1'::regclass, 'h', 'a', 10010, 's')
SELECT citus_internal_add_partition_metadata ('public.mx_ref'::regclass, 'n', NULL, 10003, 't') SELECT citus_internal_add_partition_metadata ('public.mx_ref'::regclass, 'n', NULL, 10009, 't')
SELECT citus_internal_add_partition_metadata ('public.test_table'::regclass, 'h', 'id', 10005, 's') SELECT citus_internal_add_partition_metadata ('public.test_table'::regclass, 'h', 'id', 10010, 's')
SELECT pg_catalog.worker_drop_sequence_dependency(logicalrelid::regclass::text) FROM pg_dist_partition SELECT pg_catalog.worker_drop_sequence_dependency(logicalrelid::regclass::text) FROM pg_dist_partition
SELECT pg_catalog.worker_record_sequence_dependency('mx_testing_schema.mx_test_table_col_3_seq'::regclass,'mx_testing_schema.mx_test_table'::regclass,'col_3') SELECT pg_catalog.worker_record_sequence_dependency('mx_testing_schema.mx_test_table_col_3_seq'::regclass,'mx_testing_schema.mx_test_table'::regclass,'col_3')
SELECT worker_apply_sequence_command ('CREATE SEQUENCE IF NOT EXISTS mx_testing_schema.mx_test_table_col_3_seq AS bigint INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1 NO CYCLE','bigint') SELECT worker_apply_sequence_command ('CREATE SEQUENCE IF NOT EXISTS mx_testing_schema.mx_test_table_col_3_seq AS bigint INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1 NO CYCLE','bigint')
@ -1924,7 +1924,7 @@ SELECT unnest(activate_node_snapshot()) order by 1;
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'
UPDATE pg_dist_local_group SET groupid = 1 UPDATE pg_dist_local_group SET groupid = 1
WITH colocation_group_data (colocationid, shardcount, replicationfactor, distributioncolumntype, distributioncolumncollationname, distributioncolumncollationschema) AS (VALUES (10002, 7, 1, 'integer'::regtype, NULL, NULL), (10003, 1, -1, 0, NULL, NULL), (10004, 3, 1, 'integer'::regtype, NULL, NULL), (10005, 4, 1, 'integer'::regtype, NULL, NULL)) SELECT pg_catalog.citus_internal_add_colocation_metadata(colocationid, shardcount, replicationfactor, distributioncolumntype, coalesce(c.oid, 0)) FROM colocation_group_data d LEFT JOIN pg_collation c ON (d.distributioncolumncollationname = c.collname AND d.distributioncolumncollationschema::regnamespace = c.collnamespace) WITH colocation_group_data (colocationid, shardcount, replicationfactor, distributioncolumntype, distributioncolumncollationname, distributioncolumncollationschema) AS (VALUES (10009, 1, -1, 0, NULL, NULL), (10010, 4, 1, 'integer'::regtype, NULL, NULL)) SELECT pg_catalog.citus_internal_add_colocation_metadata(colocationid, shardcount, replicationfactor, distributioncolumntype, coalesce(c.oid, 0)) FROM colocation_group_data d LEFT JOIN pg_collation c ON (d.distributioncolumncollationname = c.collname AND d.distributioncolumncollationschema::regnamespace = c.collnamespace)
WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid, force_delegation) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0, false), ('sequence', ARRAY['mx_testing_schema', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['mx_testing_schema', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['mx_test_schema_1', 'mx_table_1']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['mx_test_schema_2', 'mx_table_2']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['public', 'mx_ref']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['public', 'dist_table_1']::text[], ARRAY[]::text[], -1, 0, false), ('sequence', ARRAY['public', 'mx_test_sequence_0']::text[], ARRAY[]::text[], -1, 0, false), ('sequence', ARRAY['public', 'mx_test_sequence_1']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['public', 'test_table']::text[], ARRAY[]::text[], -1, 0, false), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0, false), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['mx_testing_schema']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['mx_testing_schema_2']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['mx_test_schema_1']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['mx_test_schema_2']::text[], ARRAY[]::text[], -1, 0, false)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int, force_delegation::bool) FROM distributed_object_data; WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid, force_delegation) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0, false), ('sequence', ARRAY['mx_testing_schema', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['mx_testing_schema', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['mx_test_schema_1', 'mx_table_1']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['mx_test_schema_2', 'mx_table_2']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['public', 'mx_ref']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['public', 'dist_table_1']::text[], ARRAY[]::text[], -1, 0, false), ('sequence', ARRAY['public', 'mx_test_sequence_0']::text[], ARRAY[]::text[], -1, 0, false), ('sequence', ARRAY['public', 'mx_test_sequence_1']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['public', 'test_table']::text[], ARRAY[]::text[], -1, 0, false), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0, false), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['mx_testing_schema']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['mx_testing_schema_2']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['mx_test_schema_1']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['mx_test_schema_2']::text[], ARRAY[]::text[], -1, 0, false)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int, force_delegation::bool) FROM distributed_object_data;
WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310000, 1, 0, 1, 100000), (1310001, 1, 0, 5, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 5, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 5, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 5, 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, 5, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 5, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 5, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 5, 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 (1310020, 1, 0, 1, 100020), (1310021, 1, 0, 5, 100021), (1310022, 1, 0, 1, 100022), (1310023, 1, 0, 5, 100023), (1310024, 1, 0, 1, 100024)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data; WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310020, 1, 0, 1, 100020), (1310021, 1, 0, 5, 100021), (1310022, 1, 0, 1, 100022), (1310023, 1, 0, 5, 100023), (1310024, 1, 0, 1, 100024)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data;

View File

@ -236,7 +236,7 @@ SELECT * FROM pg_dist_colocation WHERE colocationid = 4;
-- check to see whether metadata is synced -- check to see whether metadata is synced
SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$ SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$
SELECT array_agg(row_to_json(c)) FROM pg_dist_colocation c WHERE colocationid = 4 SELECT coalesce(array_agg(row_to_json(c)), '{}') FROM pg_dist_colocation c WHERE colocationid = 4
$$); $$);
-- create dropped colocation group again -- create dropped colocation group again