revert systemkey clear in recovery tx and backupagent on restart, moved to workload specifically

This commit is contained in:
Jon Fu 2020-10-20 17:26:16 -04:00
parent e277ce81d5
commit d82dccd2ad
4 changed files with 26 additions and 2 deletions

View File

@ -642,7 +642,7 @@ ACTOR Future<Void> restartSimulatedSystem(vector<Future<Void>>* 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"));

View File

@ -1580,7 +1580,6 @@ ACTOR Future<Void> masterCore( Reference<MasterData> 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());

View File

@ -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<Future<Void>> 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<IBackupContainer> backupContainer;
state UID backupUID;
state Version beginVersion = invalidVersion;

View File

@ -10,6 +10,7 @@ clearAfterTest = false
tag = 'default'
restoreOnly = true
checkBeginVersion = true
manualBackupAgentStart = true
[[test]]
testTitle = 'VerifyCycleAndAtomics'