| 2544 | } |
| 2545 | |
| 2546 | ACTOR 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()); |
nothing calls this directly
no test coverage detected