ServerTeamRemover:Speedup removing teams in simulation

Otherwise, simulation may time out when team remover needs to
remove hundreds of teams.
This commit is contained in:
Meng Xu 2019-07-08 18:17:19 -07:00
parent 08d76a7bbe
commit 3b9618fe11
2 changed files with 8 additions and 3 deletions

View File

@ -1725,7 +1725,7 @@ struct DDTeamCollection : ReferenceCounted<DDTeamCollection> {
int getMinTeamNumPerServer() {
int minTeamNumPerServer = std::numeric_limits<int>::max();
for (auto& s : server_info) {
minTeamNumPerServer = std::min(minTeamNumPerServer, s.second->teams.size());
minTeamNumPerServer = std::min<int>(minTeamNumPerServer, s.second->teams.size());
}
return minTeamNumPerServer;
@ -2521,7 +2521,12 @@ ACTOR Future<Void> serverTeamRemover(DDTeamCollection* self) {
}
// To avoid removing machine teams too fast, which is unlikely happen though
wait(delay(SERVER_KNOBS->TR_REMOVE_SERVER_TEAM_DELAY));
double removeServerTeamDelay = SERVER_KNOBS->TR_REMOVE_SERVER_TEAM_DELAY;
if (g_network->isSimulated()) {
// Speed up the team remover in simulation; otherwise, it may time out because we need to remove hundreds of teams
removeServerTeamDelay = removeServerTeamDelay / 10;
}
wait(delay(removeServerTeamDelay));
wait(waitUntilHealthy(self));
// Wait for the badTeamRemover() to avoid the potential race between adding the bad team (add the team tracker)

View File

@ -182,7 +182,7 @@ ServerKnobs::ServerKnobs(bool randomize, ClientKnobs* clientKnobs) {
TR_FLAG_DISABLE_MACHINE_TEAM_REMOVER = false; if( randomize && BUGGIFY ) TR_FLAG_DISABLE_MACHINE_TEAM_REMOVER = deterministicRandom()->random01() < 0.1 ? true : false; // false by default. disable the consistency check when it's true
init( TR_REMOVE_MACHINE_TEAM_DELAY, 60.0 ); if( randomize && BUGGIFY ) TR_REMOVE_MACHINE_TEAM_DELAY = deterministicRandom()->random01() * 60.0;
TR_FLAG_DISABLE_SERVER_TEAM_REMOVER = false; if( randomize && BUGGIFY ) TR_FLAG_DISABLE_SERVER_TEAM_REMOVER = deterministicRandom()->random01() < 0.1 ? true : false; // false by default. disable the consistency check when it's true
init( TR_REMOVE_SERVER_TEAM_DELAY, 60.0 ); if( randomize && BUGGIFY ) TR_REMOVE_SERVER_TEAM_DELAY = deterministicRandom()->random01() * 60.0;
init( TR_REMOVE_SERVER_TEAM_DELAY, 60.0 ); if( randomize && BUGGIFY ) TR_REMOVE_SERVER_TEAM_DELAY = deterministicRandom()->random01() * 60.0;
// Redwood Storage Engine
init( PREFIX_TREE_IMMEDIATE_KEY_SIZE_LIMIT, 30 );