Add some comment to log system

and resolve review comment by deleting my questions.
This commit is contained in:
Meng Xu 2021-02-19 21:44:07 -08:00
parent 471a3489fb
commit 33eb1de00e
5 changed files with 6 additions and 2 deletions

View File

@ -2091,6 +2091,7 @@ void registerWorker( RegisterWorkerRequest req, ClusterControllerData *self ) {
} }
} }
} }
// Recruit storage cache role. The storage cache project is paused. Its code path is unlikely used.
Optional<uint16_t> newStorageCache = req.storageCacheInterf.present() ? req.storageCacheInterf.get().first : Optional<uint16_t>(); Optional<uint16_t> newStorageCache = req.storageCacheInterf.present() ? req.storageCacheInterf.get().first : Optional<uint16_t>();
auto& cacheInfo = self->id_worker[w.locality.processId()].storageCacheInfo; auto& cacheInfo = self->id_worker[w.locality.processId()].storageCacheInfo;
if (req.storageCacheInterf.present()) { if (req.storageCacheInterf.present()) {

View File

@ -235,6 +235,8 @@ ACTOR Future<Void> waitForVersion( LogRouterData *self, Version ver ) {
return Void(); return Void();
} }
// Log router (LR) asynchronously pull data from satellite tLogs (preferred) or primary tLogs at tag (self->routerTag)
// for the version range from the LR's current version (exclusive) to its epoch's end version or recovery version.
ACTOR Future<Void> pullAsyncData( LogRouterData *self ) { ACTOR Future<Void> pullAsyncData( LogRouterData *self ) {
state Future<Void> dbInfoChange = Void(); state Future<Void> dbInfoChange = Void();
state Reference<ILogSystem::IPeekCursor> r; state Reference<ILogSystem::IPeekCursor> r;

View File

@ -60,7 +60,7 @@ public:
Reference<LocalitySet> logServerSet; Reference<LocalitySet> logServerSet;
std::vector<int> logIndexArray; std::vector<int> logIndexArray;
std::vector<LocalityEntry> logEntryArray; std::vector<LocalityEntry> logEntryArray;
bool isLocal; bool isLocal; // true if the LogSet is in primary DC or primary DC's satellite
int8_t locality; int8_t locality;
Version startVersion; Version startVersion;
std::vector<Future<TLogLockResult>> replies; std::vector<Future<TLogLockResult>> replies;

View File

@ -949,6 +949,8 @@ struct TagPartitionedLogSystem : ILogSystem, ReferenceCounted<TagPartitionedLogS
} }
} }
// Return a peek cursor that peeks data at tag from the begin version to either the recovery version if peeking at
// the latest epoch or the peek cursor's epoch's end version if peeking at an old epoch.
Reference<IPeekCursor> peekLogRouter(UID dbgid, Version begin, Tag tag) final { Reference<IPeekCursor> peekLogRouter(UID dbgid, Version begin, Tag tag) final {
bool found = false; bool found = false;
for (const auto& log : tLogs) { for (const auto& log : tLogs) {

View File

@ -214,7 +214,6 @@ struct RecruitFromConfigurationReply {
Optional<Key> dcId; // dcId is where master is recruited. It prefers to be in configuration.primaryDcId, but Optional<Key> dcId; // dcId is where master is recruited. It prefers to be in configuration.primaryDcId, but
// it can be recruited from configuration.secondaryDc: The dcId will be the secondaryDcId and // it can be recruited from configuration.secondaryDc: The dcId will be the secondaryDcId and
// this generation's primaryDC in memory is different from configuration.primaryDcId. // this generation's primaryDC in memory is different from configuration.primaryDcId.
// when is dcId set?
bool satelliteFallback; bool satelliteFallback;
RecruitFromConfigurationReply() : satelliteFallback(false) {} RecruitFromConfigurationReply() : satelliteFallback(false) {}