Don't block the exclusion of stateless processes by the free capacity check
This commit is contained in:
parent
a92669f232
commit
db8c60c80f
|
@ -1001,6 +1001,8 @@ ACTOR Future<bool> checkExclusion(Database db,
|
|||
state int64_t totalKvStoreUsedBytes = 0;
|
||||
state int64_t totalKvStoreUsedBytesNonExcluded = 0;
|
||||
state int64_t totalKvStoreAvailableBytes = 0;
|
||||
// Keep track if we exclude any storage process with the provided adddresses
|
||||
state bool excludedAddressesContainsStorageRole = false;
|
||||
|
||||
try {
|
||||
for (auto proc : processesMap.obj()) {
|
||||
|
@ -1025,6 +1027,18 @@ ACTOR Future<bool> checkExclusion(Database db,
|
|||
if (role["role"].get_str() == "storage") {
|
||||
ssTotalCount++;
|
||||
|
||||
// Check if we are excluding a process that serves the storage role. If this check was true once, we don't have to check any further
|
||||
// since we don't case in this variable about the count of excluded storage servers but only about if we exclude any storage server with the
|
||||
// provided addresses.
|
||||
if !excludedAddressesContainsStorageRole {
|
||||
for (auto exclusion : addresses) {
|
||||
if (exclusion.excludes(addr)) {
|
||||
excludedAddressesContainsStorageRole = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int64_t used_bytes;
|
||||
if (!role.get("kvstore_used_bytes", used_bytes)) {
|
||||
*msg = ManagementAPIError::toJsonString(
|
||||
|
@ -1073,6 +1087,12 @@ ACTOR Future<bool> checkExclusion(Database db,
|
|||
return false;
|
||||
}
|
||||
|
||||
// If the exclusion command only contains processes that serve a non storage role we can skip the free capacity check in order to not
|
||||
// block those exclusions.
|
||||
if ! excludedAddressesContainsStorageRole {
|
||||
return true;
|
||||
}
|
||||
|
||||
// The numerator is the total space in use by FDB that is not immediately reusable.
|
||||
// This is calculated as: used + free - available = used + free - (free - reusable) = used - reusable.
|
||||
// The denominator is the total capacity usable by FDB (either used or unused currently).
|
||||
|
|
Loading…
Reference in New Issue