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

Method peekAll

fdbserver/TagPartitionedLogSystem.actor.cpp:591–720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591Reference<ILogSystem::IPeekCursor> TagPartitionedLogSystem::peekAll(UID dbgid,
592 Version begin,
593 Version end,
594 Tag tag,
595 bool parallelGetMore) {
596 int bestSet = 0;
597 std::vector<Reference<LogSet>> localSets;
598 Version lastBegin = 0;
599 bool foundSpecial = false;
600 for (auto& log : tLogs) {
601 if (log->locality == tagLocalitySpecial || log->locality == tagLocalityUpgraded) {
602 foundSpecial = true;
603 }
604 if (log->isLocal && log->logServers.size() &&
605 (log->locality == tagLocalitySpecial || log->locality == tagLocalityUpgraded ||
606 log->locality == tag.locality || tag == txsTag || tag.locality == tagLocalityTxs ||
607 tag.locality == tagLocalityLogRouter ||
608 ((tag.locality == tagLocalityUpgraded || tag == cacheTag) && log->locality != tagLocalitySatellite))) {
609 lastBegin = std::max(lastBegin, log->startVersion);
610 localSets.push_back(log);
611 if (log->locality != tagLocalitySatellite) {
612 bestSet = localSets.size() - 1;
613 }
614 }
615 }
616
617 if (!localSets.size()) {
618 lastBegin = end;
619 }
620
621 if (begin >= lastBegin && localSets.size()) {
622 TraceEvent("TLogPeekAllCurrentOnly", dbgid)
623 .detail("Tag", tag.toString())
624 .detail("Begin", begin)
625 .detail("End", end)
626 .detail("BestLogs", localSets[bestSet]->logServerString());
627 return makeReference<ILogSystem::SetPeekCursor>(
628 localSets, bestSet, localSets[bestSet]->bestLocationFor(tag), tag, begin, end, parallelGetMore);
629 } else {
630 std::vector<Reference<ILogSystem::IPeekCursor>> cursors;
631 std::vector<LogMessageVersion> epochEnds;
632
633 if (lastBegin < end && localSets.size()) {
634 TraceEvent("TLogPeekAllAddingCurrent", dbgid)
635 .detail("Tag", tag.toString())
636 .detail("Begin", begin)
637 .detail("End", end)
638 .detail("BestLogs", localSets[bestSet]->logServerString());
639 cursors.push_back(makeReference<ILogSystem::SetPeekCursor>(
640 localSets, bestSet, localSets[bestSet]->bestLocationFor(tag), tag, lastBegin, end, parallelGetMore));
641 }
642 for (int i = 0; begin < lastBegin; i++) {
643 if (i == oldLogData.size()) {
644 if (tag == txsTag || tag.locality == tagLocalityTxs || tag == cacheTag) {
645 break;
646 }
647 TraceEvent("TLogPeekAllDead", dbgid)
648 .detail("Tag", tag.toString())

Callers 3

recoverFunction · 0.80
getUsedExtents_implFunction · 0.80

Calls 8

TraceEventClass · 0.85
LogMessageVersionClass · 0.85
detailMethod · 0.80
logServerStringMethod · 0.80
bestLocationForMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected