Don't turn mx off

pull/5453/head
Halil Ozan Akgul 2021-11-10 09:23:15 +03:00
parent 5c3692de4d
commit 1cbfd21efa
5 changed files with 29 additions and 9 deletions

View File

@ -359,18 +359,32 @@ BEGIN;
SET citus.log_remote_commands TO on; SET citus.log_remote_commands TO on;
DROP TABLE parent; DROP TABLE parent;
NOTICE: issuing BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;SELECT assign_distributed_transaction_id(xx, xx, 'xxxxxxx'); NOTICE: issuing BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;SELECT assign_distributed_transaction_id(xx, xx, 'xxxxxxx');
NOTICE: issuing SET citus.enable_ddl_propagation TO 'off'
NOTICE: issuing ALTER TABLE IF EXISTS drop_partitioned_table.parent DETACH PARTITION drop_partitioned_table.child1;
NOTICE: issuing SET citus.enable_ddl_propagation TO 'on'
NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.parent')
NOTICE: issuing BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;SELECT assign_distributed_transaction_id(xx, xx, 'xxxxxxx');
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')
ROLLBACK; ROLLBACK;
NOTICE: issuing ROLLBACK NOTICE: issuing ROLLBACK
NOTICE: issuing ROLLBACK
-- Case 2 - we shouldn't skip -- Case 2 - we shouldn't skip
BEGIN; BEGIN;
SET citus.log_remote_commands TO on; SET citus.log_remote_commands TO on;
DROP TABLE parent, child1; DROP TABLE parent, child1;
NOTICE: issuing BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;SELECT assign_distributed_transaction_id(xx, xx, 'xxxxxxx'); NOTICE: issuing BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;SELECT assign_distributed_transaction_id(xx, xx, 'xxxxxxx');
NOTICE: issuing SET citus.enable_ddl_propagation TO 'off'
NOTICE: issuing ALTER TABLE IF EXISTS drop_partitioned_table.parent DETACH PARTITION drop_partitioned_table.child1;
NOTICE: issuing SET citus.enable_ddl_propagation TO 'on'
NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.parent')
NOTICE: issuing BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;SELECT assign_distributed_transaction_id(xx, xx, 'xxxxxxx');
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 DROP TABLE IF EXISTS drop_partitioned_table.child1_xxxxx CASCADE NOTICE: issuing DROP TABLE IF EXISTS drop_partitioned_table.child1_xxxxx CASCADE
ROLLBACK; ROLLBACK;
NOTICE: issuing ROLLBACK NOTICE: issuing ROLLBACK
NOTICE: issuing ROLLBACK
DROP SCHEMA drop_partitioned_table CASCADE; DROP SCHEMA drop_partitioned_table CASCADE;
NOTICE: drop cascades to 3 other objects NOTICE: drop cascades to 3 other objects
SELECT run_command_on_workers('DROP SCHEMA IF EXISTS drop_partitioned_table CASCADE'); SELECT run_command_on_workers('DROP SCHEMA IF EXISTS drop_partitioned_table CASCADE');

View File

@ -1940,19 +1940,27 @@ DROP TABLE partitioning_test_2008, partitioning_test_2009, partitioning_test_201
-- verify this doesn't crash and gives a debug message for dropped table -- verify this doesn't crash and gives a debug message for dropped table
SET client_min_messages TO DEBUG1; SET client_min_messages TO DEBUG1;
DROP TABLE partitioning_test, reference_table; DROP TABLE partitioning_test, reference_table;
DEBUG: drop cascades to constraint partitioning_reference_fkey on table partitioning_test
DETAIL: from localhost:xxxxx
CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)"
PL/pgSQL function citus_drop_trigger() line XX at PERFORM
DEBUG: drop cascades to constraint partitioning_reference_fkey on table partitioning_test
DETAIL: from localhost:xxxxx
CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)"
PL/pgSQL function citus_drop_trigger() line XX at PERFORM
DEBUG: switching to sequential query execution mode DEBUG: switching to sequential query execution mode
DETAIL: Table "<dropped>" is modified, which might lead to data inconsistencies or distributed deadlocks via parallel accesses to hash distributed tables due to foreign keys. Any parallel modification to those hash distributed tables in the same transaction can only be executed in sequential query execution mode DETAIL: Table "<dropped>" is modified, which might lead to data inconsistencies or distributed deadlocks via parallel accesses to hash distributed tables due to foreign keys. Any parallel modification to those hash distributed tables in the same transaction can only be executed in sequential query execution mode
CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)"
PL/pgSQL function citus_drop_trigger() line XX at PERFORM PL/pgSQL function citus_drop_trigger() line XX at PERFORM
DEBUG: drop cascades to 2 other objects DEBUG: drop cascades to 2 other objects
DETAIL: drop cascades to constraint partitioning_reference_fkey_1660302 on table partitioning_schema.partitioning_test_1660302 DETAIL: drop cascades to constraint partitioning_reference_fkey_1660302 on table partitioning_test_1660302
drop cascades to constraint partitioning_reference_fkey_1660304 on table partitioning_schema.partitioning_test_1660304 drop cascades to constraint partitioning_reference_fkey_1660304 on table partitioning_test_1660304
DETAIL: from localhost:xxxxx DETAIL: from localhost:xxxxx
CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)"
PL/pgSQL function citus_drop_trigger() line XX at PERFORM PL/pgSQL function citus_drop_trigger() line XX at PERFORM
DEBUG: drop cascades to 2 other objects DEBUG: drop cascades to 2 other objects
DETAIL: drop cascades to constraint partitioning_reference_fkey_1660303 on table partitioning_schema.partitioning_test_1660303 DETAIL: drop cascades to constraint partitioning_reference_fkey_1660303 on table partitioning_test_1660303
drop cascades to constraint partitioning_reference_fkey_1660305 on table partitioning_schema.partitioning_test_1660305 drop cascades to constraint partitioning_reference_fkey_1660305 on table partitioning_test_1660305
DETAIL: from localhost:xxxxx DETAIL: from localhost:xxxxx
CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)"
PL/pgSQL function citus_drop_trigger() line XX at PERFORM PL/pgSQL function citus_drop_trigger() line XX at PERFORM
@ -3773,6 +3781,7 @@ NOTICE: Replicating reference table "supplier" to the node localhost:xxxxx
NOTICE: Replicating reference table "users_ref_test_table" to the node localhost:xxxxx NOTICE: Replicating reference table "users_ref_test_table" to the node localhost:xxxxx
NOTICE: Replicating reference table "events_reference_table" to the node localhost:xxxxx NOTICE: Replicating reference table "events_reference_table" to the node localhost:xxxxx
NOTICE: Replicating reference table "users_reference_table" to the node localhost:xxxxx NOTICE: Replicating reference table "users_reference_table" to the node localhost:xxxxx
NOTICE: localhost:xxxxx is the coordinator and already contains metadata, skipping syncing the metadata
?column? ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
1 1

View File

@ -69,7 +69,7 @@ ORDER BY 1,2,3;
\c - - - :worker_1_port \c - - - :worker_1_port
SELECT relname, conname, pg_catalog.pg_get_constraintdef(con.oid, true) SELECT relname, conname, pg_catalog.pg_get_constraintdef(con.oid, true)
FROM pg_constraint con JOIN pg_class rel ON (rel.oid=con.conrelid) FROM pg_constraint con JOIN pg_class rel ON (rel.oid=con.conrelid)
WHERE relname LIKE 'part_table%' WHERE relname SIMILAR TO 'part_table%\_\d%'
ORDER BY 1,2,3; ORDER BY 1,2,3;
relname | conname | pg_get_constraintdef relname | conname | pg_get_constraintdef
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -92,12 +92,9 @@ test: ensure_no_intermediate_data_leak
# Tests for partitioning support # Tests for partitioning support
# ---------- # ----------
test: multi_partitioning_utils replicated_partitioned_table test: multi_partitioning_utils replicated_partitioned_table
test: check_mx
test: turn_mx_off
test: multi_partitioning partitioning_issue_3970 test: multi_partitioning partitioning_issue_3970
test: drop_partitioned_table test: drop_partitioned_table
test: multi_fix_partition_shard_index_names test: multi_fix_partition_shard_index_names
test: turn_mx_on
test: partition_wise_join test: partition_wise_join
# ---------- # ----------

View File

@ -46,7 +46,7 @@ ORDER BY 1,2,3;
\c - - - :worker_1_port \c - - - :worker_1_port
SELECT relname, conname, pg_catalog.pg_get_constraintdef(con.oid, true) SELECT relname, conname, pg_catalog.pg_get_constraintdef(con.oid, true)
FROM pg_constraint con JOIN pg_class rel ON (rel.oid=con.conrelid) FROM pg_constraint con JOIN pg_class rel ON (rel.oid=con.conrelid)
WHERE relname LIKE 'part_table%' WHERE relname SIMILAR TO 'part_table%\_\d%'
ORDER BY 1,2,3; ORDER BY 1,2,3;
\c - - - :master_port \c - - - :master_port