MCPcopy Create free account
hub / github.com/apple/foundationdb / canLaunchDest

Function canLaunchDest

fdbserver/DataDistributionQueue.actor.cpp:458–474  ·  view source on GitHub ↗

candidateTeams is a vector containing one team per datacenter, the team(s) DD is planning on moving the shard to.

Source from the content-addressed store, hash-verified

456
457// candidateTeams is a vector containing one team per datacenter, the team(s) DD is planning on moving the shard to.
458bool canLaunchDest(const std::vector<std::pair<Reference<IDataDistributionTeam>, bool>>& candidateTeams,
459 int priority,
460 std::map<UID, Busyness>& busymapDest) {
461 // fail switch if this is causing issues
462 if (SERVER_KNOBS->RELOCATION_PARALLELISM_PER_DEST_SERVER <= 0) {
463 return true;
464 }
465 int workFactor = getDestWorkFactor();
466 for (auto& [team, _] : candidateTeams) {
467 for (UID id : team->getServerIDs()) {
468 if (!busymapDest[id].canLaunch(priority, workFactor)) {
469 return false;
470 }
471 }
472 }
473 return true;
474}
475
476// update busyness for each server
477void launch(RelocateData& relocation, std::map<UID, Busyness>& busymap, int singleRegionTeamSize) {

Calls 2

getDestWorkFactorFunction · 0.85
canLaunchMethod · 0.80

Tested by

no test coverage detected