adjusted priority of relocateShard requests if team contains failed server

This commit is contained in:
Jon Fu 2019-08-26 11:46:40 -07:00
parent 93079c6657
commit 202900bd79
2 changed files with 3 additions and 2 deletions

View File

@ -2855,7 +2855,8 @@ ACTOR Future<Void> teamTracker(DDTeamCollection* self, Reference<TCTeamInfo> tea
vector<KeyRange> shards = self->shardsAffectedByTeamFailure->getShardsFor( ShardsAffectedByTeamFailure::Team(team->getServerIDs(), self->primary) );
for(int i=0; i<shards.size(); i++) {
int maxPriority = team->getPriority();
// Make it high priority to move keys off failed server or else RelocateShards may never be addressed
int maxPriority = teamContainsFailedServer(self, team) ? PRIORITY_TEAM_0_LEFT : team->getPriority();
if(maxPriority < PRIORITY_TEAM_0_LEFT) {
auto teams = self->shardsAffectedByTeamFailure->getTeamsFor( shards[i] );
for( int j=0; j < teams.first.size()+teams.second.size(); j++) {

View File

@ -409,7 +409,7 @@ struct RemoveServersSafelyWorkload : TestWorkload {
if (safeKillSet) {
loop {
state bool safe = false;
auto failSet = random_subset(toKillArray, deterministicRandom()->randomInt(1, toKillArray.size() / 2 + 2));
auto failSet = random_subset(toKillArray, deterministicRandom()->randomInt(1, toKillArray.size()));
toKillMarkFailedArray.resize(failSet.size());
std::copy(failSet.begin(), failSet.end(), toKillMarkFailedArray.begin());
TraceEvent("RemoveAndKill", functionId)