Change signature of rebalanceTeams

This commit is contained in:
sfc-gh-tclinkenbeard 2022-03-17 23:27:33 -07:00
parent 14c5c78f8f
commit a04ca65ad5
1 changed files with 8 additions and 9 deletions

View File

@ -1396,10 +1396,10 @@ ACTOR Future<Void> dataDistributionRelocator(DDQueueData* self, RelocateData rd,
} }
// Move a random shard of sourceTeam's to destTeam if sourceTeam has much more data than destTeam // Move a random shard of sourceTeam's to destTeam if sourceTeam has much more data than destTeam
ACTOR Future<bool> rebalanceTeams(DDQueueData* self, ACTOR static Future<bool> rebalanceTeams(DDQueueData* self,
int priority, int priority,
Reference<IDataDistributionTeam> sourceTeam, Reference<IDataDistributionTeam> sourceTeam,
Reference<IDataDistributionTeam> destTeam, int64_t destBytes,
bool primary, bool primary,
TraceEvent* traceEvent) { TraceEvent* traceEvent) {
if (g_network->isSimulated() && g_simulator.speedUpSimulation) { if (g_network->isSimulated() && g_simulator.speedUpSimulation) {
@ -1437,7 +1437,6 @@ ACTOR Future<bool> rebalanceTeams(DDQueueData* self,
} }
int64_t sourceBytes = sourceTeam->getLoadBytes(false); int64_t sourceBytes = sourceTeam->getLoadBytes(false);
int64_t destBytes = destTeam->getLoadBytes();
bool sourceAndDestTooSimilar = bool sourceAndDestTooSimilar =
sourceBytes - destBytes <= 3 * std::max<int64_t>(SERVER_KNOBS->MIN_SHARD_BYTES, metrics.bytes); sourceBytes - destBytes <= 3 * std::max<int64_t>(SERVER_KNOBS->MIN_SHARD_BYTES, metrics.bytes);
@ -1530,7 +1529,7 @@ ACTOR Future<Void> BgDDMountainChopper(DDQueueData* self, int teamCollectionInde
bool _moved = wait(rebalanceTeams(self, bool _moved = wait(rebalanceTeams(self,
SERVER_KNOBS->PRIORITY_REBALANCE_OVERUTILIZED_TEAM, SERVER_KNOBS->PRIORITY_REBALANCE_OVERUTILIZED_TEAM,
loadedTeam.first.get(), loadedTeam.first.get(),
randomTeam.first.get(), randomTeam.first.get()->getLoadBytes(),
teamCollectionIndex == 0, teamCollectionIndex == 0,
&traceEvent)); &traceEvent));
moved = _moved; moved = _moved;
@ -1636,7 +1635,7 @@ ACTOR Future<Void> BgDDValleyFiller(DDQueueData* self, int teamCollectionIndex)
bool _moved = wait(rebalanceTeams(self, bool _moved = wait(rebalanceTeams(self,
SERVER_KNOBS->PRIORITY_REBALANCE_UNDERUTILIZED_TEAM, SERVER_KNOBS->PRIORITY_REBALANCE_UNDERUTILIZED_TEAM,
randomTeam.first.get(), randomTeam.first.get(),
unloadedTeam.first.get(), unloadedTeam.first.get()->getLoadBytes(),
teamCollectionIndex == 0, teamCollectionIndex == 0,
&traceEvent)); &traceEvent));
moved = _moved; moved = _moved;