Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion fdbserver/datadistributor/DataDistribution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,14 @@ Future<Void> StorageWiggler::finishWiggle() {
});
}

Future<Void> waitForAcceptingCommits(Reference<AsyncVar<ServerDBInfo> const> db) {
TraceEvent("DDWaitForAcceptingCommitsStart").log();
while (db->get().recoveryState < RecoveryState::ACCEPTING_COMMITS) {
TraceEvent("DDWaitForAcceptingCommits").detail("RecoveryState", (int)db->get().recoveryState);
co_await db->onChange();
}
}

Future<Void> remoteRecovered(Reference<AsyncVar<ServerDBInfo> const> db) {
TraceEvent("DDTrackerStarting").log();
while (db->get().recoveryState < RecoveryState::ALL_LOGS_RECRUITED) {
Expand Down Expand Up @@ -2900,7 +2908,11 @@ Future<Void> dataDistribution(Reference<DataDistributor> self,
self->configuration,
self->remoteDcIds,
Optional<std::vector<Optional<Key>>>(),
self->initialized.getFuture() && remoteRecovered(self->dbInfo),
// In multi-region configurations DD only needs the cluster to
// reach ACCEPTING_COMMITS before continuing startup. Waiting for
// ALL_LOGS_RECRUITED can hang during degraded failover scenarios
// such as when the primary DC is down.
self->initialized.getFuture() && waitForAcceptingCommits(self->dbInfo),
zeroHealthyTeams[1],
IsPrimary::False,
processingUnhealthy,
Expand Down
Loading