TC:TraceAllInfo:Remove unused variable

Also change some code format in self review
This commit is contained in:
Meng Xu 2019-07-12 10:33:30 -07:00
parent 4da2071b49
commit aa19da6977
1 changed files with 4 additions and 16 deletions

View File

@ -1252,7 +1252,7 @@ struct DDTeamCollection : ReferenceCounted<DDTeamCollection> {
// Locality string is hashed into integer, used as KeyIndex // Locality string is hashed into integer, used as KeyIndex
// For better understand which KeyIndex is used for locality, we print this info in trace. // For better understand which KeyIndex is used for locality, we print this info in trace.
void traceLocalityArrayIndexName(Reference<LocalityRecord> record) { void traceLocalityArrayIndexName() {
TraceEvent("LocalityRecordKeyName").detail("Size", machineLocalityMap._keymap->_lookuparray.size()); TraceEvent("LocalityRecordKeyName").detail("Size", machineLocalityMap._keymap->_lookuparray.size());
for (int i = 0; i < machineLocalityMap._keymap->_lookuparray.size(); ++i) { for (int i = 0; i < machineLocalityMap._keymap->_lookuparray.size(); ++i) {
TraceEvent("LocalityRecordKeyIndexName") TraceEvent("LocalityRecordKeyIndexName")
@ -1264,15 +1264,6 @@ struct DDTeamCollection : ReferenceCounted<DDTeamCollection> {
void traceMachineLocalityMap() { void traceMachineLocalityMap() {
int i = 0; int i = 0;
for (auto& uid : machineLocalityMap.getObjects()) {
Reference<LocalityRecord> record = machineLocalityMap.getRecord(i);
if (record.isValid()) {
// Record the Locality KeyIndex and name so that we know what each key means
traceLocalityArrayIndexName(record);
break;
}
}
TraceEvent("MachineLocalityMap").detail("Size", machineLocalityMap.size()); TraceEvent("MachineLocalityMap").detail("Size", machineLocalityMap.size());
for (auto& uid : machineLocalityMap.getObjects()) { for (auto& uid : machineLocalityMap.getObjects()) {
Reference<LocalityRecord> record = machineLocalityMap.getRecord(i); Reference<LocalityRecord> record = machineLocalityMap.getRecord(i);
@ -1301,6 +1292,7 @@ struct DDTeamCollection : ReferenceCounted<DDTeamCollection> {
traceServerTeamInfo(); traceServerTeamInfo();
traceMachineInfo(); traceMachineInfo();
traceMachineTeamInfo(); traceMachineTeamInfo();
traceLocalityArrayIndexName();
traceMachineLocalityMap(); traceMachineLocalityMap();
} }
@ -1799,10 +1791,6 @@ struct DDTeamCollection : ReferenceCounted<DDTeamCollection> {
.detail("MaxMachineTeams", maxMachineTeams) .detail("MaxMachineTeams", maxMachineTeams)
.detail("MachineTeamsToBuild", machineTeamsToBuild) .detail("MachineTeamsToBuild", machineTeamsToBuild)
.detail("RemainingMachineTeamBudget", remainingMachineTeamBudget); .detail("RemainingMachineTeamBudget", remainingMachineTeamBudget);
if (healthyMachineTeamCount == 0) {
// This should rarely happen in production cluster.
traceAllInfo(true);
}
// Pre-build all machine teams until we have the desired number of machine teams // Pre-build all machine teams until we have the desired number of machine teams
if (machineTeamsToBuild > 0 || remainingMachineTeamBudget > 0) { if (machineTeamsToBuild > 0 || remainingMachineTeamBudget > 0) {
addedMachineTeams = addBestMachineTeams(machineTeamsToBuild, remainingMachineTeamBudget); addedMachineTeams = addBestMachineTeams(machineTeamsToBuild, remainingMachineTeamBudget);
@ -3198,8 +3186,8 @@ ACTOR Future<Void> storageServerTracker(
} }
if( server->lastKnownClass.machineClassFitness( ProcessClass::Storage ) > ProcessClass::UnsetFit ) { if( server->lastKnownClass.machineClassFitness( ProcessClass::Storage ) > ProcessClass::UnsetFit ) {
// We saw a corner case in situation when optimalTeamCount = 1, healthyTeamCount = 0 in 3 data_hall // We saw a corner case in in 3 data_hall configuration
// configuration // when optimalTeamCount = 1, healthyTeamCount = 0.
if (self->optimalTeamCount > 0 && self->healthyTeamCount > 0) { if (self->optimalTeamCount > 0 && self->healthyTeamCount > 0) {
TraceEvent(SevWarn, "UndesiredStorageServer", self->distributorId) TraceEvent(SevWarn, "UndesiredStorageServer", self->distributorId)
.detail("Server", server->id) .detail("Server", server->id)