diff --git a/fdbserver/RestoreApplier.actor.cpp b/fdbserver/RestoreApplier.actor.cpp index c0624982f5..bcd7bc7e18 100644 --- a/fdbserver/RestoreApplier.actor.cpp +++ b/fdbserver/RestoreApplier.actor.cpp @@ -478,7 +478,7 @@ ACTOR static Future applyStagingKeysBatch(std::map::itera state Reference tr(new ReadYourWritesTransaction(cx)); state int sets = 0; state int clears = 0; - state Key endKey = begin->second.key; + state Key endKey = begin->first; TraceEvent(SevFRDebugInfo, "FastRestoreApplierPhaseApplyStagingKeysBatch", applierID).detail("Begin", begin->first); loop { try { @@ -508,7 +508,7 @@ ACTOR static Future applyStagingKeysBatch(std::map::itera } else { ASSERT(false); } - endKey = iter != end ? iter->second.key : endKey; + endKey = iter != end ? iter->first : endKey; iter++; if (sets > 10000000 || clears > 10000000) { TraceEvent(SevError, "FastRestoreApplierPhaseApplyStagingKeysBatchInfiniteLoop", applierID) diff --git a/fdbserver/RestoreApplier.actor.h b/fdbserver/RestoreApplier.actor.h index 5539b84ace..a56aab27b6 100644 --- a/fdbserver/RestoreApplier.actor.h +++ b/fdbserver/RestoreApplier.actor.h @@ -54,7 +54,7 @@ struct StagingKey { LogMessageVersion version; // largest version of set or clear for the key std::map> pendingMutations; // mutations not set or clear type - explicit StagingKey() : version(0), type(MutationRef::MAX_ATOMIC_OP) {} + explicit StagingKey(Key key) : key(key), version(0), type(MutationRef::MAX_ATOMIC_OP) {} // Add mutation m at newVersion to stagingKey // Assume: SetVersionstampedKey and SetVersionstampedValue have been converted to set @@ -294,7 +294,7 @@ struct ApplierBatchData : public ReferenceCounted { void addMutation(MutationRef m, LogMessageVersion ver) { if (!isRangeMutation(m)) { - auto item = stagingKeys.emplace(m.param1, StagingKey()); + auto item = stagingKeys.emplace(m.param1, StagingKey(m.param1)); item.first->second.add(m, ver); } else { stagingKeyRanges.insert(StagingKeyRange(m, ver)); diff --git a/fdbserver/RestoreUtil.h b/fdbserver/RestoreUtil.h index 111f6de0e0..ac0c7dfdef 100644 --- a/fdbserver/RestoreUtil.h +++ b/fdbserver/RestoreUtil.h @@ -39,8 +39,8 @@ #define SevFRMutationInfo SevVerbose //#define SevFRMutationInfo SevInfo -//#define SevFRDebugInfo SevVerbose -#define SevFRDebugInfo SevInfo +#define SevFRDebugInfo SevVerbose +//#define SevFRDebugInfo SevInfo struct VersionedMutation { MutationRef mutation;