mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-22 06:40:01 +08:00
Fixing BGVerifyBalance test killing issues
This commit is contained in:
parent
623db663dc
commit
bc7cc984b0
@ -2759,6 +2759,38 @@ ACTOR Future<Void> doLockChecks(Reference<BlobManagerData> bmData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ACTOR Future<Void> blobManagerExclusionSafetyCheck(Reference<BlobManagerData> self,
|
||||||
|
BlobManagerExclusionSafetyCheckRequest req) {
|
||||||
|
TraceEvent("BMExclusionSafetyCheckBegin", self->id).log();
|
||||||
|
BlobManagerExclusionSafetyCheckReply reply(true);
|
||||||
|
// make sure at least one blob worker remains after exclusions
|
||||||
|
if (self->workersById.empty()) {
|
||||||
|
TraceEvent("BMExclusionSafetyCheckNoWorkers", self->id).log();
|
||||||
|
reply.safe = false;
|
||||||
|
} else {
|
||||||
|
// TODO REMOVE prints
|
||||||
|
std::set<UID> remainingWorkers;
|
||||||
|
for (auto& worker : self->workersById) {
|
||||||
|
remainingWorkers.insert(worker.first);
|
||||||
|
}
|
||||||
|
for (const AddressExclusion& excl : req.exclusions) {
|
||||||
|
for (auto& worker : self->workersById) {
|
||||||
|
if (excl.excludes(worker.second.address())) {
|
||||||
|
remainingWorkers.erase(worker.first);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TraceEvent("BMExclusionSafetyChecked", self->id).detail("RemainingWorkers", remainingWorkers.size()).log();
|
||||||
|
reply.safe = !remainingWorkers.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
TraceEvent("BMExclusionSafetyCheckEnd", self->id).log();
|
||||||
|
req.reply.send(reply);
|
||||||
|
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
ACTOR Future<Void> blobManager(BlobManagerInterface bmInterf,
|
ACTOR Future<Void> blobManager(BlobManagerInterface bmInterf,
|
||||||
Reference<AsyncVar<ServerDBInfo> const> dbInfo,
|
Reference<AsyncVar<ServerDBInfo> const> dbInfo,
|
||||||
int64_t epoch) {
|
int64_t epoch) {
|
||||||
@ -2814,6 +2846,10 @@ ACTOR Future<Void> blobManager(BlobManagerInterface bmInterf,
|
|||||||
TraceEvent("BlobGranulesHalted", bmInterf.id()).detail("ReqID", req.requesterID);
|
TraceEvent("BlobGranulesHalted", bmInterf.id()).detail("ReqID", req.requesterID);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
when(BlobManagerExclusionSafetyCheckRequest exclCheckReq =
|
||||||
|
waitNext(bmInterf.blobManagerExclCheckReq.getFuture())) {
|
||||||
|
self->addActor.send(blobManagerExclusionSafetyCheck(self, exclCheckReq));
|
||||||
|
}
|
||||||
when(wait(collection)) {
|
when(wait(collection)) {
|
||||||
TraceEvent("BlobManagerActorCollectionError");
|
TraceEvent("BlobManagerActorCollectionError");
|
||||||
ASSERT(false);
|
ASSERT(false);
|
||||||
|
@ -31,6 +31,7 @@ struct BlobManagerInterface {
|
|||||||
RequestStream<ReplyPromise<Void>> waitFailure;
|
RequestStream<ReplyPromise<Void>> waitFailure;
|
||||||
RequestStream<struct HaltBlobManagerRequest> haltBlobManager;
|
RequestStream<struct HaltBlobManagerRequest> haltBlobManager;
|
||||||
RequestStream<struct HaltBlobGranulesRequest> haltBlobGranules;
|
RequestStream<struct HaltBlobGranulesRequest> haltBlobGranules;
|
||||||
|
RequestStream<struct BlobManagerExclusionSafetyCheckRequest> blobManagerExclCheckReq;
|
||||||
struct LocalityData locality;
|
struct LocalityData locality;
|
||||||
UID myId;
|
UID myId;
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ struct BlobManagerInterface {
|
|||||||
|
|
||||||
template <class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive& ar) {
|
void serialize(Archive& ar) {
|
||||||
serializer(ar, waitFailure, haltBlobManager, haltBlobGranules, locality, myId);
|
serializer(ar, waitFailure, haltBlobManager, haltBlobGranules, blobManagerExclCheckReq, locality, myId);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -77,4 +78,32 @@ struct HaltBlobGranulesRequest {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct BlobManagerExclusionSafetyCheckReply {
|
||||||
|
constexpr static FileIdentifier file_identifier = 8068627;
|
||||||
|
bool safe;
|
||||||
|
|
||||||
|
BlobManagerExclusionSafetyCheckReply() : safe(false) {}
|
||||||
|
explicit BlobManagerExclusionSafetyCheckReply(bool safe) : safe(safe) {}
|
||||||
|
|
||||||
|
template <class Ar>
|
||||||
|
void serialize(Ar& ar) {
|
||||||
|
serializer(ar, safe);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BlobManagerExclusionSafetyCheckRequest {
|
||||||
|
constexpr static FileIdentifier file_identifier = 1996387;
|
||||||
|
std::vector<AddressExclusion> exclusions;
|
||||||
|
ReplyPromise<BlobManagerExclusionSafetyCheckReply> reply;
|
||||||
|
|
||||||
|
BlobManagerExclusionSafetyCheckRequest() {}
|
||||||
|
explicit BlobManagerExclusionSafetyCheckRequest(std::vector<AddressExclusion> exclusions)
|
||||||
|
: exclusions(exclusions) {}
|
||||||
|
|
||||||
|
template <class Ar>
|
||||||
|
void serialize(Ar& ar) {
|
||||||
|
serializer(ar, exclusions, reply);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1802,11 +1802,21 @@ ACTOR Future<Void> proxyCheckSafeExclusion(Reference<AsyncVar<ServerDBInfo> cons
|
|||||||
return Void();
|
return Void();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
state Future<ErrorOr<DistributorExclusionSafetyCheckReply>> safeFuture =
|
state Future<ErrorOr<DistributorExclusionSafetyCheckReply>> ddSafeFuture =
|
||||||
db->get().distributor.get().distributorExclCheckReq.tryGetReply(
|
db->get().distributor.get().distributorExclCheckReq.tryGetReply(
|
||||||
DistributorExclusionSafetyCheckRequest(req.exclusions));
|
DistributorExclusionSafetyCheckRequest(req.exclusions));
|
||||||
DistributorExclusionSafetyCheckReply _reply = wait(throwErrorOr(safeFuture));
|
DistributorExclusionSafetyCheckReply _reply = wait(throwErrorOr(ddSafeFuture));
|
||||||
reply.safe = _reply.safe;
|
reply.safe = _reply.safe;
|
||||||
|
if (db->get().blobManager.present()) {
|
||||||
|
TraceEvent("SafetyCheckCommitProxyBM").detail("BMID", db->get().blobManager.get().id());
|
||||||
|
state Future<ErrorOr<BlobManagerExclusionSafetyCheckReply>> bmSafeFuture =
|
||||||
|
db->get().blobManager.get().blobManagerExclCheckReq.tryGetReply(
|
||||||
|
BlobManagerExclusionSafetyCheckRequest(req.exclusions));
|
||||||
|
BlobManagerExclusionSafetyCheckReply _reply = wait(throwErrorOr(bmSafeFuture));
|
||||||
|
reply.safe &= _reply.safe;
|
||||||
|
} else {
|
||||||
|
TraceEvent("SafetyCheckCommitProxyNoBM");
|
||||||
|
}
|
||||||
} catch (Error& e) {
|
} catch (Error& e) {
|
||||||
TraceEvent("SafetyCheckCommitProxyResponseError").error(e);
|
TraceEvent("SafetyCheckCommitProxyResponseError").error(e);
|
||||||
if (e.code() != error_code_operation_cancelled) {
|
if (e.code() != error_code_operation_cancelled) {
|
||||||
|
@ -29,10 +29,6 @@ testTitle = 'BlobGranuleVerifyBalance'
|
|||||||
testDuration = 120.0
|
testDuration = 120.0
|
||||||
meanDelay = 10.0
|
meanDelay = 10.0
|
||||||
|
|
||||||
[[test.workload]]
|
|
||||||
testName = 'Attrition'
|
|
||||||
testDuration = 120.0
|
|
||||||
|
|
||||||
[[test.workload]]
|
[[test.workload]]
|
||||||
testName = 'Attrition'
|
testName = 'Attrition'
|
||||||
machinesToKill = 10
|
machinesToKill = 10
|
||||||
|
Loading…
x
Reference in New Issue
Block a user