mirror of https://github.com/citusdata/citus.git
Merge pull request #2790 from citusdata/fix_fkey_error
Change the order of placement access added to the placement access listpull/2793/head
commit
9a137e9486
|
@ -1250,7 +1250,7 @@ GetModifyConnections(Task *task, bool markCritical)
|
||||||
|
|
||||||
/* create placement access for the placement that we're modifying */
|
/* create placement access for the placement that we're modifying */
|
||||||
placementModification = CreatePlacementAccess(taskPlacement, accessType);
|
placementModification = CreatePlacementAccess(taskPlacement, accessType);
|
||||||
placementAccessList = lappend(placementAccessList, placementModification);
|
placementAccessList = lcons(placementModification, placementAccessList);
|
||||||
|
|
||||||
/* get an appropriate connection for the DML statement */
|
/* get an appropriate connection for the DML statement */
|
||||||
multiConnection = GetPlacementListConnection(connectionFlags, placementAccessList,
|
multiConnection = GetPlacementListConnection(connectionFlags, placementAccessList,
|
||||||
|
|
|
@ -538,7 +538,7 @@ ROLLBACK;
|
||||||
BEGIN;
|
BEGIN;
|
||||||
ALTER TABLE on_update_fkey_table ADD COLUMN X int;
|
ALTER TABLE on_update_fkey_table ADD COLUMN X int;
|
||||||
UPDATE referece_table SET id = 160 WHERE id = 15;
|
UPDATE referece_table SET id = 160 WHERE id = 15;
|
||||||
ERROR: cannot execute SELECT on reference relation "referece_table" because there was a parallel DDL access to distributed relation "on_update_fkey_table" in the same transaction
|
ERROR: cannot execute DML on reference relation "referece_table" because there was a parallel DDL access to distributed relation "on_update_fkey_table" in the same transaction
|
||||||
HINT: Try re-running the transaction with "SET LOCAL citus.multi_shard_modify_mode TO 'sequential';"
|
HINT: Try re-running the transaction with "SET LOCAL citus.multi_shard_modify_mode TO 'sequential';"
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
-- case 6:5: Unrelated parallel DDL on distributed table followed by unrelated DDL on ref. table
|
-- case 6:5: Unrelated parallel DDL on distributed table followed by unrelated DDL on ref. table
|
||||||
|
|
|
@ -538,7 +538,7 @@ ROLLBACK;
|
||||||
BEGIN;
|
BEGIN;
|
||||||
ALTER TABLE on_update_fkey_table ADD COLUMN X int;
|
ALTER TABLE on_update_fkey_table ADD COLUMN X int;
|
||||||
UPDATE referece_table SET id = 160 WHERE id = 15;
|
UPDATE referece_table SET id = 160 WHERE id = 15;
|
||||||
ERROR: cannot execute SELECT on reference relation "referece_table" because there was a parallel DDL access to distributed relation "on_update_fkey_table" in the same transaction
|
ERROR: cannot execute DML on reference relation "referece_table" because there was a parallel DDL access to distributed relation "on_update_fkey_table" in the same transaction
|
||||||
HINT: Try re-running the transaction with "SET LOCAL citus.multi_shard_modify_mode TO 'sequential';"
|
HINT: Try re-running the transaction with "SET LOCAL citus.multi_shard_modify_mode TO 'sequential';"
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
-- case 6:5: Unrelated parallel DDL on distributed table followed by unrelated DDL on ref. table
|
-- case 6:5: Unrelated parallel DDL on distributed table followed by unrelated DDL on ref. table
|
||||||
|
|
Loading…
Reference in New Issue