mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-18 03:42:10 +08:00
Check if all specific processes are excluded
This commit is contained in:
parent
da346d718f
commit
0bc8e2cea6
@ -160,6 +160,28 @@ ACTOR Future<std::set<NetworkAddress>> checkForExcludingServers(Reference<IDatab
|
|||||||
for (const auto& addr : exclusionInProgress)
|
for (const auto& addr : exclusionInProgress)
|
||||||
inProgressExclusion.insert(NetworkAddress::parse(
|
inProgressExclusion.insert(NetworkAddress::parse(
|
||||||
addr.key.removePrefix(fdb_cli::exclusionInProgressSpecialKeyRange.begin).toString()));
|
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)
|
if (!waitForAllExcluded)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user