Check if all specific processes are excluded

This commit is contained in:
Johannes M. Scheuermann 2022-05-25 17:08:02 +01:00
parent da346d718f
commit 0bc8e2cea6

View File

@ -160,6 +160,28 @@ ACTOR Future<std::set<NetworkAddress>> checkForExcludingServers(Reference<IDatab
for (const auto& addr : exclusionInProgress)
inProgressExclusion.insert(NetworkAddress::parse(
addr.key.removePrefix(fdb_cli::exclusionInProgressSpecialKeyRange.begin).toString()));
// Check if all of the specified exclusions are done.
bool allExcluded = true;
for (const auto& inProgressAddr : exclusionInProgress) {
if (!allExcluded) {
break;
}
for (const auto& exclusion : exclusions) {
// We found an exclusion that is still in progress
if (exclusion.excludes(inProgressAddr)) {
allExcluded = false;
break;
}
}
}
if (allExcluded) {
inProgressExclusion.clear();
return inProgressExclusion;
}
if (!waitForAllExcluded)
break;