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

Method newRemoteEpoch

fdbserver/TagPartitionedLogSystem.actor.cpp:2546–2584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2544}
2545
2546ACTOR Future<Void> TagPartitionedLogSystem::newRemoteEpoch(TagPartitionedLogSystem* self,
2547 Reference<TagPartitionedLogSystem> oldLogSystem,
2548 Future<RecruitRemoteFromConfigurationReply> fRemoteWorkers,
2549 UID clusterId,
2550 DatabaseConfiguration configuration,
2551 LogEpoch recoveryCount,
2552 Version recoveryTransactionVersion,
2553 int8_t remoteLocality,
2554 std::vector<Tag> allTags) {
2555 TraceEvent("RemoteLogRecruitment_WaitingForWorkers").log();
2556 state RecruitRemoteFromConfigurationReply remoteWorkers = wait(fRemoteWorkers);
2557
2558 state Reference<LogSet> logSet(new LogSet());
2559 logSet->tLogReplicationFactor = configuration.getRemoteTLogReplicationFactor();
2560 logSet->tLogVersion = configuration.tLogVersion;
2561 logSet->tLogPolicy = configuration.getRemoteTLogPolicy();
2562 logSet->isLocal = false;
2563 logSet->locality = remoteLocality;
2564
2565 logSet->startVersion = oldLogSystem->knownCommittedVersion + 1;
2566 state int lockNum = 0;
2567 while (lockNum < oldLogSystem->lockResults.size()) {
2568 if (oldLogSystem->lockResults[lockNum].logSet->locality == remoteLocality) {
2569
2570 loop {
2571 auto versions =
2572 TagPartitionedLogSystem::getDurableVersion(self->dbgid, oldLogSystem->lockResults[lockNum]);
2573 if (versions.present()) {
2574 logSet->startVersion =
2575 std::min(std::min(std::get<0>(versions.get()) + 1, oldLogSystem->lockResults[lockNum].epochEnd),
2576 logSet->startVersion);
2577 break;
2578 }
2579 wait(TagPartitionedLogSystem::getDurableVersionChanged(oldLogSystem->lockResults[lockNum]));
2580 }
2581 break;
2582 }
2583 lockNum++;
2584 }
2585
2586 std::vector<LocalityData> localities;
2587 localities.resize(remoteWorkers.remoteTLogs.size());

Callers

nothing calls this directly

Calls 8

TraceEventClass · 0.85
getDurableVersionFunction · 0.85
getRemoteTLogPolicyMethod · 0.80
getMethod · 0.65
logMethod · 0.45
sizeMethod · 0.45
presentMethod · 0.45

Tested by

no test coverage detected