diff --git a/fdbserver/RestoreApplier.actor.cpp b/fdbserver/RestoreApplier.actor.cpp index 2497a1af84..cd2cf944bb 100644 --- a/fdbserver/RestoreApplier.actor.cpp +++ b/fdbserver/RestoreApplier.actor.cpp @@ -89,9 +89,10 @@ ACTOR Future restoreApplierCore(RestoreApplierInterface applierInterf, int break; } } - TraceEvent("RestoreApplierCore", self->id()).detail("Request", requestTypeStr); // For debug only + //TraceEvent("RestoreApplierCore", self->id()).detail("Request", requestTypeStr); // For debug only } catch (Error& e) { - TraceEvent(SevWarn, "FastRestoreApplierError", self->id()) + bool isError = e.code() != error_code_operation_cancelled; + TraceEvent(isError ? SevError : SevWarnAlways, "FastRestoreApplierError", self->id()) .detail("RequestType", requestTypeStr) .error(e, true); actors.clear(false); @@ -466,7 +467,7 @@ ACTOR static Future precomputeMutationsResult(Reference ACTOR static Future applyStagingKeysBatch(std::map::iterator begin, std::map::iterator end, Database cx, FlowLock* applyStagingKeysBatchLock, UID applierID, - ApplierBatchData::Counters* cc) { + ApplierBatchData::Counters* cc, KeyRangeRef range) { if (SERVER_KNOBS->FASTRESTORE_NOT_WRITE_DB) { TraceEvent("FastRestoreApplierPhaseApplyStagingKeysBatchSkipped", applierID).detail("Begin", begin->first); ASSERT(!g_network->isSimulated()); @@ -483,7 +484,7 @@ ACTOR static Future applyStagingKeysBatch(std::map::itera try { tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::LOCK_AWARE); - tr->addWriteConflictRange(KeyRangeRef(begin->first, endKey)); // Reduce resolver load + tr->addWriteConflictRange(range); // Reduce resolver load std::map::iterator iter = begin; while (iter != end) { if (iter->second.type == MutationRef::SetValue) { @@ -548,7 +549,7 @@ ACTOR static Future applyStagingKeys(Reference batchData txnSize += cur->second.expectedMutationSize(); if (txnSize > SERVER_KNOBS->FASTRESTORE_TXN_BATCH_MAX_BYTES) { fBatches.push_back(applyStagingKeysBatch(begin, cur, cx, &batchData->applyStagingKeysBatchLock, applierID, - &batchData->counters)); + &batchData->counters, KeyRangeRef(begin->first, cur->first))); batchData->counters.appliedBytes += txnSize; batchData->appliedBytes += txnSize; begin = cur; @@ -558,8 +559,9 @@ ACTOR static Future applyStagingKeys(Reference batchData cur++; } if (begin != batchData->stagingKeys.end()) { + KeyRangeRef range(begin->first, keyAfter(batchData->stagingKeys.rbegin()->first)); fBatches.push_back(applyStagingKeysBatch(begin, cur, cx, &batchData->applyStagingKeysBatchLock, applierID, - &batchData->counters)); + &batchData->counters, range)); batchData->counters.appliedBytes += txnSize; batchData->appliedBytes += txnSize; txnBatches++; diff --git a/fdbserver/RestoreLoader.actor.cpp b/fdbserver/RestoreLoader.actor.cpp index 18e77e9d04..9735b97c64 100644 --- a/fdbserver/RestoreLoader.actor.cpp +++ b/fdbserver/RestoreLoader.actor.cpp @@ -282,8 +282,8 @@ ACTOR Future restoreLoaderCore(RestoreLoaderInterface loaderInterf, int no when(wait(error)) { TraceEvent("FastRestoreLoaderActorCollectionError", self->id()); } } } catch (Error& e) { - TraceEvent(e.code() == error_code_broken_promise ? SevError : SevWarnAlways, "FastRestoreLoaderError", - self->id()) + bool isError = e.code() != error_code_operation_cancelled; // == error_code_broken_promise + TraceEvent(isError ? SevError : SevWarnAlways, "FastRestoreLoaderError", self->id()) .detail("RequestType", requestTypeStr) .error(e, true); actors.clear(false);