diff --git a/fdbserver/SimulatedCluster.actor.cpp b/fdbserver/SimulatedCluster.actor.cpp index becb1f4ae3..3743caed2b 100644 --- a/fdbserver/SimulatedCluster.actor.cpp +++ b/fdbserver/SimulatedCluster.actor.cpp @@ -642,7 +642,7 @@ ACTOR Future restartSimulatedSystem(vector>* systemActors, st // SOMEDAY: parse backup agent from test file systemActors->push_back(reportErrors( simulatedMachine(conn, ipAddrs, usingSSL, localities, processClass, baseFolder, true, - i == useSeedForMachine, AgentAddition, + i == useSeedForMachine, enableExtraDB ? AgentAddition : AgentNone, usingSSL && (listenersPerProcess == 1 || processClass == ProcessClass::TesterClass), whitelistBinPaths), processClass == ProcessClass::TesterClass ? "SimulatedTesterMachine" : "SimulatedMachine")); diff --git a/fdbserver/masterserver.actor.cpp b/fdbserver/masterserver.actor.cpp index 6dbcefc5be..953dc0244a 100644 --- a/fdbserver/masterserver.actor.cpp +++ b/fdbserver/masterserver.actor.cpp @@ -1580,7 +1580,6 @@ ACTOR Future masterCore( Reference self ) { tr.set(recoveryCommitRequest.arena, snapshotEndVersionKey, (bw << self->lastEpochEnd).toValue()); // Clear the key so multiple recoveries will not overwrite the first version recorded tr.clear(recoveryCommitRequest.arena, singleKeyRange(writeRecoveryKey)); - tr.clear(recoveryCommitRequest.arena, fileBackupPrefixRange); } if(self->forceRecovery) { BinaryWriter bw(Unversioned()); diff --git a/fdbserver/workloads/IncrementalBackup.actor.cpp b/fdbserver/workloads/IncrementalBackup.actor.cpp index 32f6d9210d..d10f779924 100644 --- a/fdbserver/workloads/IncrementalBackup.actor.cpp +++ b/fdbserver/workloads/IncrementalBackup.actor.cpp @@ -19,6 +19,7 @@ */ #include "fdbclient/FDBTypes.h" +#include "fdbclient/Knobs.h" #include "fdbclient/SystemData.h" #include "fdbclient/ReadYourWrites.h" #include "fdbrpc/simulator.h" @@ -40,6 +41,10 @@ struct IncrementalBackupWorkload : TestWorkload { int waitRetries; bool stopBackup; bool checkBeginVersion; + bool manualBackupAgentStart; + + double backupPollDelay = 1.0 / CLIENT_KNOBS->BACKUP_AGGREGATE_POLL_RATE; + std::vector> agentFutures; IncrementalBackupWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { backupDir = getOption(options, LiteralStringRef("backupDir"), LiteralStringRef("file://simfdb/backups/")); @@ -50,6 +55,7 @@ struct IncrementalBackupWorkload : TestWorkload { waitRetries = getOption(options, LiteralStringRef("waitRetries"), -1); stopBackup = getOption(options, LiteralStringRef("stopBackup"), false); checkBeginVersion = getOption(options, LiteralStringRef("checkBeginVersion"), false); + manualBackupAgentStart = getOption(options, LiteralStringRef("manualBackupAgentStart"), false); } std::string description() const override { return "IncrementalBackup"; } @@ -151,6 +157,24 @@ struct IncrementalBackupWorkload : TestWorkload { TraceEvent("IBackupSubmitSuccess"); } if (self->restoreOnly) { + if (self->manualBackupAgentStart) { + state Transaction earlyTr(cx); + // Clear Relevant System Keys + loop { + try { + earlyTr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + earlyTr.setOption(FDBTransactionOptions::LOCK_AWARE); + earlyTr.clear(fileBackupPrefixRange); + wait(earlyTr.commit()); + break; + } catch (Error& e) { + wait(earlyTr.onError(e)); + } + } + TraceEvent("IBackupRunBackupAgent"); + self->agentFutures.push_back( + self->backupAgent.run(cx, &self->backupPollDelay, CLIENT_KNOBS->SIM_BACKUP_TASKS_PER_AGENT)); + } state Reference backupContainer; state UID backupUID; state Version beginVersion = invalidVersion; diff --git a/tests/restarting/from_7.0.0/SnapIncrementalRestore-2.toml b/tests/restarting/from_7.0.0/SnapIncrementalRestore-2.toml index 2a71789242..91bcc1baeb 100644 --- a/tests/restarting/from_7.0.0/SnapIncrementalRestore-2.toml +++ b/tests/restarting/from_7.0.0/SnapIncrementalRestore-2.toml @@ -10,6 +10,7 @@ clearAfterTest = false tag = 'default' restoreOnly = true checkBeginVersion = true + manualBackupAgentStart = true [[test]] testTitle = 'VerifyCycleAndAtomics'