mirror of https://github.com/citusdata/citus.git
Merge pull request #3772 from citusdata/fixes_from_enterprise
Use block_writes for replicate_reference_tablespull/3752/head
commit
c3324f8962
|
@ -216,7 +216,7 @@ EnsureReferenceTablesExistOnAllNodes(void)
|
||||||
StringInfo placementCopyCommand =
|
StringInfo placementCopyCommand =
|
||||||
CopyShardPlacementToWorkerNodeQuery(sourceShardPlacement,
|
CopyShardPlacementToWorkerNodeQuery(sourceShardPlacement,
|
||||||
newWorkerNode,
|
newWorkerNode,
|
||||||
TRANSFER_MODE_AUTOMATIC);
|
TRANSFER_MODE_BLOCK_WRITES);
|
||||||
ExecuteCriticalRemoteCommand(connection, placementCopyCommand->data);
|
ExecuteCriticalRemoteCommand(connection, placementCopyCommand->data);
|
||||||
RemoteTransactionCommit(connection);
|
RemoteTransactionCommit(connection);
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,3 +114,5 @@ s/pg_catalog.citus_extradata_container\([0-9]+/pg_catalog.citus_extradata_contai
|
||||||
|
|
||||||
# ignore referene table replication messages
|
# ignore referene table replication messages
|
||||||
/replicating reference table.*$/d
|
/replicating reference table.*$/d
|
||||||
|
|
||||||
|
s/Citus.*currently supports/Citus currently supports/g
|
||||||
|
|
|
@ -318,7 +318,7 @@ SELECT create_distributed_table('referencing_table', 'ref_id');
|
||||||
|
|
||||||
ALTER TABLE referencing_table ADD CONSTRAINT fkey_ref FOREIGN KEY (id) REFERENCES referenced_table(id);
|
ALTER TABLE referencing_table ADD CONSTRAINT fkey_ref FOREIGN KEY (id) REFERENCES referenced_table(id);
|
||||||
ERROR: cannot create foreign key constraint
|
ERROR: cannot create foreign key constraint
|
||||||
DETAIL: Citus Community Edition currently supports foreign key constraints only for "citus.shard_replication_factor = 1".
|
DETAIL: Citus currently supports foreign key constraints only for "citus.shard_replication_factor = 1".
|
||||||
HINT: Please change "citus.shard_replication_factor to 1". To learn more about using foreign keys with other replication factors, please contact us at https://citusdata.com/about/contact_us.
|
HINT: Please change "citus.shard_replication_factor to 1". To learn more about using foreign keys with other replication factors, please contact us at https://citusdata.com/about/contact_us.
|
||||||
SELECT * FROM table_fkeys_in_workers WHERE relid LIKE 'fkey_reference_table.%' AND refd_relid LIKE 'fkey_reference_table.%' ORDER BY 1,2,3;
|
SELECT * FROM table_fkeys_in_workers WHERE relid LIKE 'fkey_reference_table.%' AND refd_relid LIKE 'fkey_reference_table.%' ORDER BY 1,2,3;
|
||||||
name | relid | refd_relid
|
name | relid | refd_relid
|
||||||
|
@ -336,7 +336,7 @@ SELECT create_distributed_table('referencing_table', 'ref_id');
|
||||||
|
|
||||||
ALTER TABLE referencing_table ADD COLUMN referencing_col int REFERENCES referenced_table(id) ON DELETE SET NULL;
|
ALTER TABLE referencing_table ADD COLUMN referencing_col int REFERENCES referenced_table(id) ON DELETE SET NULL;
|
||||||
ERROR: cannot create foreign key constraint
|
ERROR: cannot create foreign key constraint
|
||||||
DETAIL: Citus Community Edition currently supports foreign key constraints only for "citus.shard_replication_factor = 1".
|
DETAIL: Citus currently supports foreign key constraints only for "citus.shard_replication_factor = 1".
|
||||||
HINT: Please change "citus.shard_replication_factor to 1". To learn more about using foreign keys with other replication factors, please contact us at https://citusdata.com/about/contact_us.
|
HINT: Please change "citus.shard_replication_factor to 1". To learn more about using foreign keys with other replication factors, please contact us at https://citusdata.com/about/contact_us.
|
||||||
SELECT * FROM table_fkeys_in_workers WHERE relid LIKE 'fkey_reference_table.%' AND refd_relid LIKE 'fkey_reference_table.%' ORDER BY 1,2,3;
|
SELECT * FROM table_fkeys_in_workers WHERE relid LIKE 'fkey_reference_table.%' AND refd_relid LIKE 'fkey_reference_table.%' ORDER BY 1,2,3;
|
||||||
name | relid | refd_relid
|
name | relid | refd_relid
|
||||||
|
|
|
@ -42,7 +42,7 @@ DROP TABLE referencing_table;
|
||||||
CREATE TABLE self_referencing_table(id int, ref_id int, PRIMARY KEY (id, ref_id), FOREIGN KEY(id,ref_id) REFERENCES self_referencing_table(id, ref_id));
|
CREATE TABLE self_referencing_table(id int, ref_id int, PRIMARY KEY (id, ref_id), FOREIGN KEY(id,ref_id) REFERENCES self_referencing_table(id, ref_id));
|
||||||
SELECT create_distributed_table('self_referencing_table', 'id', 'hash');
|
SELECT create_distributed_table('self_referencing_table', 'id', 'hash');
|
||||||
ERROR: cannot create foreign key constraint
|
ERROR: cannot create foreign key constraint
|
||||||
DETAIL: Citus Community Edition currently supports foreign key constraints only for "citus.shard_replication_factor = 1".
|
DETAIL: Citus currently supports foreign key constraints only for "citus.shard_replication_factor = 1".
|
||||||
HINT: Please change "citus.shard_replication_factor to 1". To learn more about using foreign keys with other replication factors, please contact us at https://citusdata.com/about/contact_us.
|
HINT: Please change "citus.shard_replication_factor to 1". To learn more about using foreign keys with other replication factors, please contact us at https://citusdata.com/about/contact_us.
|
||||||
DROP TABLE self_referencing_table;
|
DROP TABLE self_referencing_table;
|
||||||
CREATE TABLE self_referencing_table(id int, ref_id int, PRIMARY KEY (id, ref_id));
|
CREATE TABLE self_referencing_table(id int, ref_id int, PRIMARY KEY (id, ref_id));
|
||||||
|
@ -54,7 +54,7 @@ SELECT create_distributed_table('self_referencing_table', 'id', 'hash');
|
||||||
|
|
||||||
ALTER TABLE self_referencing_table ADD CONSTRAINT fkey FOREIGN KEY(id,ref_id) REFERENCES self_referencing_table(id, ref_id);
|
ALTER TABLE self_referencing_table ADD CONSTRAINT fkey FOREIGN KEY(id,ref_id) REFERENCES self_referencing_table(id, ref_id);
|
||||||
ERROR: cannot create foreign key constraint
|
ERROR: cannot create foreign key constraint
|
||||||
DETAIL: Citus Community Edition currently supports foreign key constraints only for "citus.shard_replication_factor = 1".
|
DETAIL: Citus currently supports foreign key constraints only for "citus.shard_replication_factor = 1".
|
||||||
HINT: Please change "citus.shard_replication_factor to 1". To learn more about using foreign keys with other replication factors, please contact us at https://citusdata.com/about/contact_us.
|
HINT: Please change "citus.shard_replication_factor to 1". To learn more about using foreign keys with other replication factors, please contact us at https://citusdata.com/about/contact_us.
|
||||||
DROP TABLE self_referencing_table;
|
DROP TABLE self_referencing_table;
|
||||||
-- test foreign constraint creation on NOT co-located tables
|
-- test foreign constraint creation on NOT co-located tables
|
||||||
|
@ -81,7 +81,7 @@ DROP TABLE referencing_table;
|
||||||
CREATE TABLE referencing_table(id int, ref_id int, FOREIGN KEY(ref_id) REFERENCES referenced_table(id));
|
CREATE TABLE referencing_table(id int, ref_id int, FOREIGN KEY(ref_id) REFERENCES referenced_table(id));
|
||||||
SELECT create_distributed_table('referencing_table', 'ref_id', 'hash');
|
SELECT create_distributed_table('referencing_table', 'ref_id', 'hash');
|
||||||
ERROR: cannot create foreign key constraint
|
ERROR: cannot create foreign key constraint
|
||||||
DETAIL: Citus Community Edition currently supports foreign key constraints only for "citus.shard_replication_factor = 1".
|
DETAIL: Citus currently supports foreign key constraints only for "citus.shard_replication_factor = 1".
|
||||||
HINT: Please change "citus.shard_replication_factor to 1". To learn more about using foreign keys with other replication factors, please contact us at https://citusdata.com/about/contact_us.
|
HINT: Please change "citus.shard_replication_factor to 1". To learn more about using foreign keys with other replication factors, please contact us at https://citusdata.com/about/contact_us.
|
||||||
DROP TABLE referencing_table;
|
DROP TABLE referencing_table;
|
||||||
DROP TABLE referenced_table;
|
DROP TABLE referenced_table;
|
||||||
|
|
|
@ -157,7 +157,7 @@ ADD CONSTRAINT
|
||||||
REFERENCES
|
REFERENCES
|
||||||
fkey_test(key) ON DELETE CASCADE;
|
fkey_test(key) ON DELETE CASCADE;
|
||||||
ERROR: cannot create foreign key constraint
|
ERROR: cannot create foreign key constraint
|
||||||
DETAIL: Citus Community Edition currently supports foreign key constraints only for "citus.shard_replication_factor = 1".
|
DETAIL: Citus currently supports foreign key constraints only for "citus.shard_replication_factor = 1".
|
||||||
HINT: Please change "citus.shard_replication_factor to 1". To learn more about using foreign keys with other replication factors, please contact us at https://citusdata.com/about/contact_us.
|
HINT: Please change "citus.shard_replication_factor to 1". To learn more about using foreign keys with other replication factors, please contact us at https://citusdata.com/about/contact_us.
|
||||||
-- we should be able to attach and detach partitions
|
-- we should be able to attach and detach partitions
|
||||||
-- given that those DDLs are on the parent table
|
-- given that those DDLs are on the parent table
|
||||||
|
|
Loading…
Reference in New Issue