ConsistencyCheck:Check minServerTeamOnServer larger than 0

This commit is contained in:
Meng Xu 2019-07-09 20:51:08 -07:00
parent aa459a2b03
commit 9816fb6aca
2 changed files with 5 additions and 1 deletions

View File

@ -1775,6 +1775,9 @@ struct DDTeamCollection : ReferenceCounted<DDTeamCollection> {
.detail("MaxMachineTeams", maxMachineTeams)
.detail("MachineTeamsToBuild", machineTeamsToBuild)
.detail("RemainingMachineTeamBudget", remainingMachineTeamBudget);
if (healthyMachineTeamCount == 0) {
traceAllInfo(true);
}
// Pre-build all machine teams until we have the desired number of machine teams
if (machineTeamsToBuild > 0 || remainingMachineTeamBudget > 0) {
addedMachineTeams = addBestMachineTeams(machineTeamsToBuild, remainingMachineTeamBudget);

View File

@ -304,9 +304,10 @@ ACTOR Future<bool> getTeamCollectionValid(Database cx, WorkerInterface dataDistr
// The if condition should be consistent with the condition in serverTeamRemover() and
// machineTeamRemover() that decides if redundant teams exist.
// Team number is always valid when we disable teamRemover. This avoids false positive in simulation test
// We ensure each server (machine) has at least 1 team if
if ((!SERVER_KNOBS->TR_FLAG_DISABLE_MACHINE_TEAM_REMOVER && healthyMachineTeamCount > desiredMachineTeamNumber) ||
(!SERVER_KNOBS->TR_FLAG_DISABLE_SERVER_TEAM_REMOVER && currentTeamNumber > desiredTeamNumber) ||
(minMachineTeamOnMachine <= 0 && SERVER_KNOBS->DESIRED_TEAMS_PER_SERVER == 3)) {
((minMachineTeamOnMachine <= 0 || minServerTeamOnServer <= 0) && SERVER_KNOBS->DESIRED_TEAMS_PER_SERVER == 3)) {
if (attempts++ < 10) {
wait(delay(60));
continue; // We may not receive the most recent TeamCollectionInfo