Do not move a shard to a node that it already exists on

pull/7076/head
ahmet gedemenli 2023-07-20 16:39:56 +03:00 committed by Ahmet Gedemenli
parent c968dc9c27
commit 3f11139b5c
1 changed files with 9 additions and 1 deletions

View File

@ -2796,7 +2796,15 @@ FindAllowedTargetFillState(RebalanceState *state, uint64 shardId)
targetFillState->node,
state->functions->context))
{
return targetFillState;
bool targetHasShard = PlacementsHashFind(state->placementsHash,
shardId,
targetFillState->node);
/* skip if the shard is already placed on the target node */
if (!targetHasShard)
{
return targetFillState;
}
}
}
return NULL;