diff --git a/fdbserver/DataDistributionQueue.actor.cpp b/fdbserver/DataDistributionQueue.actor.cpp index df6bca3b4d..fe83813d2e 100644 --- a/fdbserver/DataDistributionQueue.actor.cpp +++ b/fdbserver/DataDistributionQueue.actor.cpp @@ -49,7 +49,7 @@ struct RelocateData { TraceInterval interval; RelocateData() : startTime(-1), priority(-1), boundaryPriority(-1), healthPriority(-1), workFactor(0), wantsNewServers(false), interval("QueuedRelocation") {} - RelocateData( RelocateShard const& rs ) : keys(rs.keys), priority(rs.priority), boundaryPriority(isBoundaryPriority(rs.priority) ? rs.priority : -1), healthPriority(isHealthPriority(rs.priority) ? rs.priority : -1), startTime(now()), randomId(deterministicRandom()->randomUniqueID()), workFactor(0), + explicit RelocateData( RelocateShard const& rs ) : keys(rs.keys), priority(rs.priority), boundaryPriority(isBoundaryPriority(rs.priority) ? rs.priority : -1), healthPriority(isHealthPriority(rs.priority) ? rs.priority : -1), startTime(now()), randomId(deterministicRandom()->randomUniqueID()), workFactor(0), wantsNewServers( rs.priority == SERVER_KNOBS->PRIORITY_REBALANCE_OVERUTILIZED_TEAM || rs.priority == SERVER_KNOBS->PRIORITY_REBALANCE_UNDERUTILIZED_TEAM || @@ -599,12 +599,14 @@ struct DDQueueData { } //This function cannot handle relocation requests which split a shard into three pieces - void queueRelocation( RelocateData rd, std::set &serversToLaunchFrom ) { + void queueRelocation( RelocateShard rs, std::set &serversToLaunchFrom ) { //TraceEvent("QueueRelocationBegin").detail("Begin", rd.keys.begin).detail("End", rd.keys.end); // remove all items from both queues that are fully contained in the new relocation (i.e. will be overwritten) - bool hasHealthPriority = rd.healthPriority != -1; - bool hasBoundaryPriority = rd.boundaryPriority != -1; + RelocateData rd(rs); + bool hasHealthPriority = RelocateData::isHealthPriority( rd.priority ); + bool hasBoundaryPriority = RelocateData::isBoundaryPriority( rd.priority ); + auto ranges = queueMap.intersectingRanges( rd.keys ); for(auto r = ranges.begin(); r != ranges.end(); ++r ) { RelocateData& rrs = r->value(); diff --git a/fdbserver/Knobs.cpp b/fdbserver/Knobs.cpp index 76ad385383..8f2d22a31a 100644 --- a/fdbserver/Knobs.cpp +++ b/fdbserver/Knobs.cpp @@ -117,7 +117,7 @@ ServerKnobs::ServerKnobs(bool randomize, ClientKnobs* clientKnobs) { init( PRIORITY_TEAM_2_LEFT, 709 ); init( PRIORITY_TEAM_1_LEFT, 800 ); init( PRIORITY_TEAM_0_LEFT, 809 ); - init( PRIORITY_SPLIT_SHARD, 900 ); + init( PRIORITY_SPLIT_SHARD, 900 ); if( randomize && BUGGIFY ) PRIORITY_SPLIT_SHARD = 350; // Data distribution init( RETRY_RELOCATESHARD_DELAY, 0.1 );