MCPcopy Create free account
hub / github.com/apple/foundationdb / clusterRecruitStorage

Function clusterRecruitStorage

fdbserver/ClusterController.actor.cpp:888–908  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886}
887
888void clusterRecruitStorage(ClusterControllerData* self, RecruitStorageRequest req) {
889 try {
890 if (!self->gotProcessClasses && !req.criticalRecruitment)
891 throw no_more_servers();
892 auto worker = self->getStorageWorker(req);
893 RecruitStorageReply rep;
894 rep.worker = worker.interf;
895 rep.processClass = worker.processClass;
896 req.reply.send(rep);
897 } catch (Error& e) {
898 if (e.code() == error_code_no_more_servers) {
899 self->outstandingStorageRequests.emplace_back(req, now() + SERVER_KNOBS->RECRUITMENT_TIMEOUT);
900 TraceEvent(SevWarn, "RecruitStorageNotAvailable", self->id)
901 .error(e)
902 .detail("IsCriticalRecruitment", req.criticalRecruitment);
903 } else {
904 TraceEvent(SevError, "RecruitStorageError", self->id).error(e);
905 throw; // Any other error will bring down the cluster controller
906 }
907 }
908}
909
910// Trys to send a reply to req with a worker (process) that a blob worker can be recruited on
911// Otherwise, add the req to a list of outstanding reqs that will eventually be dealt with

Callers 1

whenFunction · 0.85

Calls 8

nowFunction · 0.85
TraceEventClass · 0.85
getStorageWorkerMethod · 0.80
emplace_backMethod · 0.80
detailMethod · 0.80
sendMethod · 0.45
codeMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected