mirror of https://github.com/citusdata/citus.git
done
parent
4cea8c148f
commit
f54f9166a5
|
@ -436,11 +436,6 @@ CreateDistributedTableConcurrently(Oid relationId, char *distributionColumnName,
|
||||||
|
|
||||||
char replicationModel = DecideDistTableReplicationModel(distributionMethod,
|
char replicationModel = DecideDistTableReplicationModel(distributionMethod,
|
||||||
colocateWithTableName);
|
colocateWithTableName);
|
||||||
if (replicationModel != REPLICATION_MODEL_STREAMING)
|
|
||||||
{
|
|
||||||
ereport(ERROR, (errmsg("cannot create a replicated distributed "
|
|
||||||
"table concurrently")));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* we fail transaction before local table conversion if the table could not be colocated with
|
* we fail transaction before local table conversion if the table could not be colocated with
|
||||||
|
@ -450,6 +445,19 @@ CreateDistributedTableConcurrently(Oid relationId, char *distributionColumnName,
|
||||||
if (!IsColocateWithDefault(colocateWithTableName) && !IsColocateWithNone(
|
if (!IsColocateWithDefault(colocateWithTableName) && !IsColocateWithNone(
|
||||||
colocateWithTableName))
|
colocateWithTableName))
|
||||||
{
|
{
|
||||||
|
if (replicationModel != REPLICATION_MODEL_STREAMING)
|
||||||
|
{
|
||||||
|
ereport(ERROR, (errmsg("cannot create distributed table "
|
||||||
|
"concurrently because Citus allows "
|
||||||
|
"concurrent table distribution only when "
|
||||||
|
"citus.shard_replication_factor = 1"),
|
||||||
|
errhint("table %s is requested to be colocated "
|
||||||
|
"with %s which has "
|
||||||
|
"citus.shard_replication_factor > 1",
|
||||||
|
get_rel_name(relationId),
|
||||||
|
colocateWithTableName)));
|
||||||
|
}
|
||||||
|
|
||||||
EnsureColocateWithTableIsValid(relationId, distributionMethod,
|
EnsureColocateWithTableIsValid(relationId, distributionMethod,
|
||||||
distributionColumnName,
|
distributionColumnName,
|
||||||
colocateWithTableName);
|
colocateWithTableName);
|
||||||
|
|
|
@ -47,7 +47,8 @@ select create_distributed_table('dist_1', 'a');
|
||||||
set citus.shard_replication_factor to 1;
|
set citus.shard_replication_factor to 1;
|
||||||
create table dist_2(a int);
|
create table dist_2(a int);
|
||||||
select create_distributed_table_concurrently('dist_2', 'a', colocate_with=>'dist_1');
|
select create_distributed_table_concurrently('dist_2', 'a', colocate_with=>'dist_1');
|
||||||
ERROR: cannot create a replicated distributed table concurrently
|
ERROR: cannot create distributed table concurrently because Citus allows concurrent table distribution only when citus.shard_replication_factor = 1
|
||||||
|
HINT: table dist_2 is requested to be colocated with dist_1 which has citus.shard_replication_factor > 1
|
||||||
begin;
|
begin;
|
||||||
select create_distributed_table_concurrently('test','key');
|
select create_distributed_table_concurrently('test','key');
|
||||||
ERROR: create_distributed_table_concurrently cannot run inside a transaction block
|
ERROR: create_distributed_table_concurrently cannot run inside a transaction block
|
||||||
|
|
Loading…
Reference in New Issue