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

Method LogData

fdbserver/TLogServer.actor.cpp:634–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632 // that came when ignorePopRequest was set
633
634 explicit LogData(TLogData* tLogData,
635 TLogInterface interf,
636 Tag remoteTag,
637 bool isPrimary,
638 int logRouterTags,
639 int txsTags,
640 UID recruitmentID,
641 ProtocolVersion protocolVersion,
642 TLogSpillType logSpillType,
643 std::vector<Tag> tags,
644 std::string context)
645 : initialized(false), queueCommittingVersion(0), knownCommittedVersion(0), durableKnownCommittedVersion(0),
646 minKnownCommittedVersion(0), queuePoppedVersion(0), minPoppedTagVersion(0), minPoppedTag(invalidTag),
647 unpoppedRecoveredTagCount(0), cc("TLog", interf.id().toString()), bytesInput("BytesInput", cc),
648 bytesDurable("BytesDurable", cc), blockingPeeks("BlockingPeeks", cc),
649 blockingPeekTimeouts("BlockingPeekTimeouts", cc), emptyPeeks("EmptyPeeks", cc),
650 nonEmptyPeeks("NonEmptyPeeks", cc), logId(interf.id()), protocolVersion(protocolVersion),
651 newPersistentDataVersion(invalidVersion), tLogData(tLogData), unrecoveredBefore(1), recoveredAt(1),
652 recoveryTxnVersion(1), logSystem(new AsyncVar<Reference<ILogSystem>>()), remoteTag(remoteTag),
653 isPrimary(isPrimary), logRouterTags(logRouterTags), logRouterPoppedVersion(0), logRouterPopToVersion(0),
654 locality(tagLocalityInvalid), recruitmentID(recruitmentID), logSpillType(logSpillType),
655 allTags(tags.begin(), tags.end()), terminated(tLogData->terminated.getFuture()), execOpCommitInProgress(false),
656 txsTags(txsTags) {
657 startRole(Role::TRANSACTION_LOG,
658 interf.id(),
659 tLogData->workerID,
660 { { "SharedTLog", tLogData->dbgid.shortString() } },
661 context);
662 addActor.send(traceRole(Role::TRANSACTION_LOG, interf.id()));
663
664 persistentDataVersion.init(LiteralStringRef("TLog.PersistentDataVersion"), cc.id);
665 persistentDataDurableVersion.init(LiteralStringRef("TLog.PersistentDataDurableVersion"), cc.id);
666 version.initMetric(LiteralStringRef("TLog.Version"), cc.id);
667 queueCommittedVersion.initMetric(LiteralStringRef("TLog.QueueCommittedVersion"), cc.id);
668
669 specialCounter(cc, "Version", [this]() { return this->version.get(); });
670 specialCounter(cc, "QueueCommittedVersion", [this]() { return this->queueCommittedVersion.get(); });
671 specialCounter(cc, "PersistentDataVersion", [this]() { return this->persistentDataVersion; });
672 specialCounter(cc, "PersistentDataDurableVersion", [this]() { return this->persistentDataDurableVersion; });
673 specialCounter(cc, "KnownCommittedVersion", [this]() { return this->knownCommittedVersion; });
674 specialCounter(cc, "QueuePoppedVersion", [this]() { return this->queuePoppedVersion; });
675 specialCounter(cc, "MinPoppedTagVersion", [this]() { return this->minPoppedTagVersion; });
676 // The locality and id of the tag that is responsible for making the TLog hold onto its oldest piece of data.
677 // If disk queues are growing and no one is sure why, then you shall look at this to find the tag responsible
678 // for why the TLog thinks it can't throw away data.
679 specialCounter(cc, "MinPoppedTagLocality", [this]() { return this->minPoppedTag.locality; });
680 specialCounter(cc, "MinPoppedTagId", [this]() { return this->minPoppedTag.id; });
681 specialCounter(cc, "SharedBytesInput", [tLogData]() { return tLogData->bytesInput; });
682 specialCounter(cc, "SharedBytesDurable", [tLogData]() { return tLogData->bytesDurable; });
683 specialCounter(cc, "SharedOverheadBytesInput", [tLogData]() { return tLogData->overheadBytesInput; });
684 specialCounter(cc, "SharedOverheadBytesDurable", [tLogData]() { return tLogData->overheadBytesDurable; });
685 specialCounter(cc, "PeekMemoryReserved", [tLogData]() { return tLogData->peekMemoryLimiter.activePermits(); });
686 specialCounter(cc, "PeekMemoryRequestsStalled", [tLogData]() { return tLogData->peekMemoryLimiter.waiters(); });
687 specialCounter(cc, "Generation", [this]() { return this->recoveryCount; });
688 specialCounter(cc, "ActivePeekStreams", [tLogData]() { return tLogData->activePeekStreams; });
689 }
690
691 ~LogData() {

Callers

nothing calls this directly

Calls 14

startRoleFunction · 0.85
specialCounterFunction · 0.85
shortStringMethod · 0.80
initMetricMethod · 0.80
activePermitsMethod · 0.80
waitersMethod · 0.80
getMethod · 0.65
toStringMethod · 0.45
idMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getFutureMethod · 0.45

Tested by

no test coverage detected