Skip to content

Commit

Permalink
Move EnsureReferenceTablesExistOnAllNodesExtended to somewhere after …
Browse files Browse the repository at this point in the history
…the check
  • Loading branch information
agedemenli committed Mar 9, 2023
1 parent 92779b9 commit dd41d6e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/backend/distributed/operations/shard_rebalancer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,6 @@ static void
RebalanceTableShards(RebalanceOptions *options, Oid shardReplicationModeOid)
{
char transferMode = LookupShardTransferMode(shardReplicationModeOid);
EnsureReferenceTablesExistOnAllNodesExtended(transferMode);

if (list_length(options->relationIdList) == 0)
{
Expand All @@ -1836,11 +1835,6 @@ RebalanceTableShards(RebalanceOptions *options, Oid shardReplicationModeOid)

List *placementUpdateList = GetRebalanceSteps(options);

if (list_length(placementUpdateList) == 0)
{
return;
}

if (transferMode == TRANSFER_MODE_AUTOMATIC)
{
/*
Expand All @@ -1858,6 +1852,13 @@ RebalanceTableShards(RebalanceOptions *options, Oid shardReplicationModeOid)
}
}

EnsureReferenceTablesExistOnAllNodesExtended(transferMode);

if (list_length(placementUpdateList) == 0)
{
return;
}

/*
* This uses the first relationId from the list, it's only used for display
* purposes so it does not really matter which to show
Expand Down

0 comments on commit dd41d6e

Please sign in to comment.