diff --git a/fdbcli/fdbcli.actor.cpp b/fdbcli/fdbcli.actor.cpp index 7b3c5f1719..8becd0d566 100644 --- a/fdbcli/fdbcli.actor.cpp +++ b/fdbcli/fdbcli.actor.cpp @@ -1674,7 +1674,18 @@ ACTOR Future exclude( Database db, std::vector tokens, Referenc state double worstFreeSpaceRatio = 1.0; try { for (auto proc : processesMap.obj()){ + bool storageServer = false; StatusArray rolesArray = proc.second.get_obj()["roles"].get_array(); + for (StatusObjectReader role : rolesArray) { + if (role["role"].get_str() == "storage") { + storageServer = true; + break; + } + } + // Skip non-storage servers in free space calculation + if (!storageServer) + continue; + StatusObjectReader process(proc.second); std::string addrStr; if (!process.get("address", addrStr)) { @@ -1683,6 +1694,9 @@ ACTOR Future exclude( Database db, std::vector tokens, Referenc } NetworkAddress addr = NetworkAddress::parse(addrStr); bool excluded = (process.has("excluded") && process.last().get_bool()) || addressExcluded(exclusions, addr); + ssTotalCount++; + if (excluded) + ssExcludedCount++; if(!excluded) { StatusObjectReader disk; @@ -1705,15 +1719,6 @@ ACTOR Future exclude( Database db, std::vector tokens, Referenc worstFreeSpaceRatio = std::min(worstFreeSpaceRatio, double(free_bytes)/total_bytes); } - - for (StatusObjectReader role : rolesArray) { - if (role["role"].get_str() == "storage") { - if (excluded) - ssExcludedCount++; - ssTotalCount++; - break; - } - } } } catch (...) // std::exception