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

Function when

fdbserver/TagPartitionedLogSystem.actor.cpp:3135–3163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3133 try {
3134 loop choose {
3135 when(TLogRejoinRequest req = waitNext(rejoinRequests)) {
3136 int pos = -1;
3137 for (int i = 0; i < logServers.size(); i++) {
3138 if (logServers[i].first->get().id() == req.myInterface.id()) {
3139 pos = i;
3140 logsWaiting.erase(logServers[i].first->get().id());
3141 break;
3142 }
3143 }
3144 if (pos != -1) {
3145 TraceEvent("TLogJoinedMe", dbgid)
3146 .detail("TLog", req.myInterface.id())
3147 .detail("Address", req.myInterface.commit.getEndpoint().getPrimaryAddress().toString());
3148 if (!logServers[pos].first->get().present() ||
3149 req.myInterface.commit.getEndpoint() !=
3150 logServers[pos].first->get().interf().commit.getEndpoint()) {
3151 TLogInterface interf = req.myInterface;
3152 filterLocalityDataForPolicyDcAndProcess(logServers[pos].second, &interf.filteredLocality);
3153 logServers[pos].first->setUnconditional(OptionalInterface<TLogInterface>(interf));
3154 }
3155 lastReply[req.myInterface.id()].send(TLogRejoinReply{ false });
3156 lastReply[req.myInterface.id()] = req.reply;
3157 } else {
3158 TraceEvent("TLogJoinedMeUnknown", dbgid)
3159 .detail("TLog", req.myInterface.id())
3160 .detail("Address", req.myInterface.commit.getEndpoint().getPrimaryAddress().toString());
3161 req.reply.send(true);
3162 }
3163 }
3164 when(wait(warnTimeout)) {
3165 for (const auto& logId : logsWaiting) {
3166 TraceEvent(SevWarnAlways, "TLogRejoinSlow", dbgid)

Callers 2

lockTLogMethod · 0.70

Calls 13

TraceEventClass · 0.85
nowFunction · 0.85
detailMethod · 0.80
getMethod · 0.65
NeverClass · 0.50
sizeMethod · 0.45
idMethod · 0.45
eraseMethod · 0.45
toStringMethod · 0.45
presentMethod · 0.45
setUnconditionalMethod · 0.45

Tested by

no test coverage detected