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

Method _execute

fdbclient/FileBackupAgent.actor.cpp:1992–2030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1990 };
1991
1992 ACTOR static Future<Void> _execute(Database cx,
1993 Reference<TaskBucket> taskBucket,
1994 Reference<FutureBucket> futureBucket,
1995 Reference<Task> task) {
1996 state Reference<FlowLock> lock(new FlowLock(CLIENT_KNOBS->BACKUP_LOCK_BYTES));
1997
1998 wait(checkTaskVersion(cx, task, BackupLogRangeTaskFunc::name, BackupLogRangeTaskFunc::version));
1999
2000 state Version beginVersion = Params.beginVersion().get(task);
2001 state Version endVersion = Params.endVersion().get(task);
2002
2003 state BackupConfig config(task);
2004 state Reference<IBackupContainer> bc;
2005
2006 state Reference<ReadYourWritesTransaction> tr(new ReadYourWritesTransaction(cx));
2007 loop {
2008 tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS);
2009 tr->setOption(FDBTransactionOptions::LOCK_AWARE);
2010 // Wait for the read version to pass endVersion
2011 try {
2012 wait(taskBucket->keepRunning(tr, task));
2013
2014 if (!bc) {
2015 // Backup container must be present if we're still here
2016 Reference<IBackupContainer> _bc = wait(config.backupContainer().getOrThrow(tr));
2017 bc = _bc;
2018 }
2019
2020 Version currentVersion = tr->getReadVersion().get();
2021 if (endVersion < currentVersion)
2022 break;
2023
2024 wait(delay(std::max(CLIENT_KNOBS->BACKUP_RANGE_MINWAIT,
2025 (double)(endVersion - currentVersion) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND)));
2026 tr->reset();
2027 } catch (Error& e) {
2028 wait(tr->onError(e));
2029 }
2030 }
2031
2032 Key destUidValue = wait(config.destUidValue().getOrThrow(tr));
2033

Callers

nothing calls this directly

Calls 11

delayFunction · 0.85
keepRunningMethod · 0.80
backupContainerMethod · 0.80
getMethod · 0.65
setOptionMethod · 0.65
getReadVersionMethod · 0.65
onErrorMethod · 0.65
beginVersionMethod · 0.45
endVersionMethod · 0.45
getOrThrowMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected