diff --git a/fdbclient/DatabaseBackupAgent.actor.cpp b/fdbclient/DatabaseBackupAgent.actor.cpp index 1454584794..5df7d2d2ef 100644 --- a/fdbclient/DatabaseBackupAgent.actor.cpp +++ b/fdbclient/DatabaseBackupAgent.actor.cpp @@ -890,6 +890,7 @@ namespace dbBackup { return Void(); } + tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); UID logUid = BinaryReader::fromStringRef(task->params[DatabaseBackupAgent::keyConfigLogUid], Unversioned()); Key logsPath = uidPrefixKey(applyLogKeys.begin, logUid); tr->clear(KeyRangeRef(logsPath, strinc(logsPath))); @@ -1491,13 +1492,15 @@ public: ACTOR static Future abortBackup(DatabaseBackupAgent* backupAgent, Database cx, Key tagName, bool partial) { state Reference tr(new ReadYourWritesTransaction(cx)); - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); state Key logUid; state Value backupUid; loop { try { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); + UID _logUid = wait(backupAgent->getLogUid(tr, tagName)); logUid = BinaryWriter::toValue(_logUid, Unversioned()); diff --git a/fdbclient/FileBackupAgent.actor.cpp b/fdbclient/FileBackupAgent.actor.cpp index 6b5759d623..e9488e4fcd 100644 --- a/fdbclient/FileBackupAgent.actor.cpp +++ b/fdbclient/FileBackupAgent.actor.cpp @@ -224,6 +224,8 @@ public: } void clearApplyMutationsKeys(Reference tr) { + tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); + // Clear add/remove prefix keys tr->clear(uidPrefixKey(applyMutationsAddPrefixRange.begin, uid)); tr->clear(uidPrefixKey(applyMutationsRemovePrefixRange.begin, uid)); @@ -1709,6 +1711,7 @@ namespace fileBackup { state Key configPath = uidPrefixKey(logRangesRange.begin, uid); state Key logsPath = uidPrefixKey(backupLogKeys.begin, uid); + tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); tr->clear(KeyRangeRef(configPath, strinc(configPath))); tr->clear(KeyRangeRef(logsPath, strinc(logsPath))); backup.stateEnum().set(tr, EBackupState::STATE_COMPLETED); @@ -2749,6 +2752,7 @@ namespace fileBackup { ACTOR Future abortRestore(Reference tr, Key tagName) { tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::LOCK_AWARE); + tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); state KeyBackedTag tag = makeRestoreTag(tagName.toString()); state Optional current = wait(tag.get(tr)); @@ -2797,6 +2801,7 @@ namespace fileBackup { try { tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::LOCK_AWARE); + tr->setOption(FDBTransactionOptions::COMMIT_ON_FIRST_PROXY); tr->addReadConflictRange(singleKeyRange(KeyRef())); tr->addWriteConflictRange(singleKeyRange(KeyRef())); Void _ = wait(tr->commit());