Merge pull request #7249 from johscheuer/fix-fdbcli-exclude-check

Check if all specific processes are excluded
This commit is contained in:
Jingyu Zhou 2022-05-26 15:01:01 -07:00 committed by GitHub
commit db5508520c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

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 : inProgressExclusion) {
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;