TeamCollection:Count healthy machine teams only
Team collection should prioritize to build machine teams for a machine that has the least number of healthy machine teams, instead of just machine teams, because unhealthy machine team will not be able to produce more server teams.
This commit is contained in:
parent
ee916b337d
commit
e1d459075a
|
@ -1342,7 +1342,12 @@ struct DDTeamCollection : ReferenceCounted<DDTeamCollection> {
|
|||
// Invariant: We only create correct size machine teams.
|
||||
// When configuration (e.g., team size) is changed, the DDTeamCollection will be destroyed and rebuilt
|
||||
// so that the invariant will not be violated.
|
||||
int teamCount = machine.second->machineTeams.size();
|
||||
int teamCount = 0;
|
||||
for (auto& mt : machine.second->machineTeams) {
|
||||
if ( isMachineTeamHealthy(mt) ) {
|
||||
++teamCount;
|
||||
}
|
||||
}
|
||||
|
||||
if (teamCount < minTeamCount) {
|
||||
leastUsedMachines.clear();
|
||||
|
|
Loading…
Reference in New Issue