mirror of https://github.com/citusdata/citus.git
parent
93c0ec1095
commit
20a887b951
|
@ -436,7 +436,7 @@ BigIntArrayDatumContains(Datum *array, int arrayLength, uint64 toFind)
|
||||||
* FullShardPlacementList returns a List containing all the shard placements of
|
* FullShardPlacementList returns a List containing all the shard placements of
|
||||||
* a specific table (excluding the excludedShardArray)
|
* a specific table (excluding the excludedShardArray)
|
||||||
*/
|
*/
|
||||||
List *
|
static List *
|
||||||
FullShardPlacementList(Oid relationId, ArrayType *excludedShardArray)
|
FullShardPlacementList(Oid relationId, ArrayType *excludedShardArray)
|
||||||
{
|
{
|
||||||
List *shardPlacementList = NIL;
|
List *shardPlacementList = NIL;
|
||||||
|
|
|
@ -50,7 +50,10 @@
|
||||||
#include "distributed/version_compat.h"
|
#include "distributed/version_compat.h"
|
||||||
#include "distributed/worker_protocol.h"
|
#include "distributed/worker_protocol.h"
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
extern List * FullShardPlacementList(Oid relationId, ArrayType *excludedShardArray);
|
extern List * FullShardPlacementList(Oid relationId, ArrayType *excludedShardArray);
|
||||||
|
=======
|
||||||
|
>>>>>>> parent of c48bf5eba (Rename per worker)
|
||||||
static char * PartitionBound(Oid partitionId);
|
static char * PartitionBound(Oid partitionId);
|
||||||
static Relation try_relation_open_nolock(Oid relationId);
|
static Relation try_relation_open_nolock(Oid relationId);
|
||||||
static List * CreateFixPartitionConstraintsTaskList(Oid relationId);
|
static List * CreateFixPartitionConstraintsTaskList(Oid relationId);
|
||||||
|
@ -556,33 +559,17 @@ CreateFixPartitionShardIndexNames(Oid parentRelationId, Oid partitionRelationId,
|
||||||
/* lock metadata before getting placement lists */
|
/* lock metadata before getting placement lists */
|
||||||
LockShardListMetadata(parentShardIntervalList, ShareLock);
|
LockShardListMetadata(parentShardIntervalList, ShareLock);
|
||||||
|
|
||||||
int taskId = 1;
|
|
||||||
|
|
||||||
List *shardPlacementList = FullShardPlacementList(parentRelationId,
|
|
||||||
construct_empty_array(INT4OID));
|
|
||||||
|
|
||||||
|
|
||||||
List *workerNodeList = ReadDistNode(true);
|
|
||||||
|
|
||||||
/* make sure we have deterministic output for our tests */
|
|
||||||
workerNodeList = SortList(workerNodeList, CompareWorkerNodes);
|
|
||||||
|
|
||||||
MemoryContext localContext = AllocSetContextCreate(CurrentMemoryContext,
|
MemoryContext localContext = AllocSetContextCreate(CurrentMemoryContext,
|
||||||
"CreateFixPartitionShardIndexNames",
|
"CreateFixPartitionShardIndexNames",
|
||||||
ALLOCSET_DEFAULT_SIZES);
|
ALLOCSET_DEFAULT_SIZES);
|
||||||
MemoryContext oldContext = MemoryContextSwitchTo(localContext);
|
MemoryContext oldContext = MemoryContextSwitchTo(localContext);
|
||||||
|
|
||||||
WorkerNode *workerNode = NULL;
|
int taskId = 1;
|
||||||
foreach_ptr(workerNode, workerNodeList)
|
|
||||||
{
|
|
||||||
List *shardsOnNode = FilterActiveShardPlacementListByNode(
|
|
||||||
shardPlacementList, workerNode);
|
|
||||||
|
|
||||||
ShardPlacement *shardPlacement = NULL;
|
ShardInterval *parentShardInterval = NULL;
|
||||||
|
foreach_ptr(parentShardInterval, parentShardIntervalList)
|
||||||
foreach_ptr(shardPlacement, shardsOnNode)
|
|
||||||
{
|
{
|
||||||
uint64 parentShardId = shardPlacement->shardId;
|
uint64 parentShardId = parentShardInterval->shardId;
|
||||||
|
|
||||||
List *queryStringList =
|
List *queryStringList =
|
||||||
WorkerFixPartitionShardIndexNamesCommandList(parentShardId,
|
WorkerFixPartitionShardIndexNamesCommandList(parentShardId,
|
||||||
|
@ -611,9 +598,6 @@ CreateFixPartitionShardIndexNames(Oid parentRelationId, Oid partitionRelationId,
|
||||||
ExecuteUtilityTaskList(list_make1(task), localExecutionSupported);
|
ExecuteUtilityTaskList(list_make1(task), localExecutionSupported);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* after every iteration, clean-up all the memory associated with it */
|
/* after every iteration, clean-up all the memory associated with it */
|
||||||
MemoryContextReset(localContext);
|
MemoryContextReset(localContext);
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,6 +222,4 @@ extern void SetupRebalanceMonitor(List *placementUpdateList,
|
||||||
uint64 initialProgressState,
|
uint64 initialProgressState,
|
||||||
PlacementUpdateStatus initialStatus);
|
PlacementUpdateStatus initialStatus);
|
||||||
|
|
||||||
extern List * FullShardPlacementList(Oid relationId, ArrayType *excludedShardArray);
|
|
||||||
|
|
||||||
#endif /* SHARD_REBALANCER_H */
|
#endif /* SHARD_REBALANCER_H */
|
||||||
|
|
Loading…
Reference in New Issue