mirror of https://github.com/citusdata/citus.git
fix, the ommission of reference table colocation group unders certain circumstances because it breaks tests
parent
5f73e44d7c
commit
4a290560b2
|
@ -527,7 +527,7 @@ CreateDistributedTable(Oid relationId, char *distributionColumnName,
|
|||
* This function does not expect to create Citus local table, so we blindly
|
||||
* create reference table when the method is DISTRIBUTE_BY_NONE.
|
||||
*/
|
||||
CreateReferenceTableShard(relationId, colocatedTableId);
|
||||
CreateReferenceTableShard(relationId);
|
||||
}
|
||||
|
||||
if (ShouldSyncTableMetadata(relationId))
|
||||
|
|
|
@ -158,7 +158,10 @@ PreprocessDropTableStmt(Node *node, const char *queryString,
|
|||
* prevent concurrent mutations to the placements of the shard groups.
|
||||
*/
|
||||
CitusTableCacheEntry *cacheEntry = GetCitusTableCacheEntry(relationId);
|
||||
LockColocationId(cacheEntry->colocationId, ShareLock);
|
||||
if (cacheEntry->colocationId != INVALID_COLOCATION_ID)
|
||||
{
|
||||
LockColocationId(cacheEntry->colocationId, ShareLock);
|
||||
}
|
||||
|
||||
/* invalidate foreign key cache if the table involved in any foreign key */
|
||||
if ((TableReferenced(relationId) || TableReferencing(relationId)))
|
||||
|
|
|
@ -326,7 +326,7 @@ CreateColocatedShards(Oid targetRelationId, Oid sourceRelationId, bool
|
|||
* Also, the shard is replicated to the all active nodes in the cluster.
|
||||
*/
|
||||
void
|
||||
CreateReferenceTableShard(Oid distributedTableId, Oid colocatedTableId)
|
||||
CreateReferenceTableShard(Oid distributedTableId)
|
||||
{
|
||||
int workerStartIndex = 0;
|
||||
text *shardMinValue = NULL;
|
||||
|
|
|
@ -99,13 +99,7 @@ EnsureReferenceTablesExistOnAllNodesExtended(char transferMode)
|
|||
uint64 shardId = INVALID_SHARD_ID;
|
||||
List *newWorkersList = NIL;
|
||||
const char *referenceTableName = NULL;
|
||||
int colocationId = GetReferenceTableColocationId();
|
||||
|
||||
if (colocationId == INVALID_COLOCATION_ID)
|
||||
{
|
||||
/* no colocation for reference tables available */
|
||||
return;
|
||||
}
|
||||
int colocationId = CreateReferenceTableColocationId();
|
||||
|
||||
/*
|
||||
* Most of the time this function should result in a conclusion where we do not need
|
||||
|
|
|
@ -249,7 +249,7 @@ extern void CreateShardsWithRoundRobinPolicy(Oid distributedTableId, int32 shard
|
|||
bool useExclusiveConnections);
|
||||
extern void CreateColocatedShards(Oid targetRelationId, Oid sourceRelationId,
|
||||
bool useExclusiveConnections);
|
||||
extern void CreateReferenceTableShard(Oid distributedTableId, Oid colocatedTableId);
|
||||
extern void CreateReferenceTableShard(Oid distributedTableId);
|
||||
extern List * WorkerCreateShardCommandList(Oid relationId, int shardIndex, uint64 shardId,
|
||||
List *ddlCommandList,
|
||||
List *foreignConstraintCommandList);
|
||||
|
|
Loading…
Reference in New Issue