From fbf5020af9f2f8fa013d576bfe092b639da5bd7d Mon Sep 17 00:00:00 2001 From: Meng Xu Date: Wed, 26 Feb 2020 11:27:30 -0800 Subject: [PATCH] FastRestore:Applier:Add fetchKeys counter --- fdbserver/RestoreApplier.actor.cpp | 1 + fdbserver/RestoreApplier.actor.h | 3 ++- fdbserver/RestoreCommon.actor.h | 4 +--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fdbserver/RestoreApplier.actor.cpp b/fdbserver/RestoreApplier.actor.cpp index e398e0ae8c..a628025883 100644 --- a/fdbserver/RestoreApplier.actor.cpp +++ b/fdbserver/RestoreApplier.actor.cpp @@ -306,6 +306,7 @@ ACTOR static Future precomputeMutationsResult(Reference for (; stagingKeyIter != batchData->stagingKeys.end(); stagingKeyIter++) { if (!stagingKeyIter->second.hasBaseValue()) { imcompleteStagingKeys.emplace(stagingKeyIter->first, stagingKeyIter); + batchData->counters.fetchKeys++; } } diff --git a/fdbserver/RestoreApplier.actor.h b/fdbserver/RestoreApplier.actor.h index 6782186650..99b7a08a66 100644 --- a/fdbserver/RestoreApplier.actor.h +++ b/fdbserver/RestoreApplier.actor.h @@ -218,13 +218,14 @@ struct ApplierBatchData : public ReferenceCounted { Counter receivedBytes, receivedWeightedBytes, receivedMutations, receivedAtomicOps; Counter appliedWeightedBytes, appliedMutations, appliedAtomicOps; Counter appliedTxns; + Counter fetchKeys; // number of keys to fetch from dest. FDB cluster. Counters(ApplierBatchData* self, UID applierInterfID, int batchIndex) : cc("ApplierBatch", applierInterfID.toString() + ":" + std::to_string(batchIndex)), receivedBytes("ReceivedBytes", cc), receivedMutations("ReceivedMutations", cc), receivedAtomicOps("ReceivedAtomicOps", cc), receivedWeightedBytes("ReceivedWeightedMutations", cc), appliedWeightedBytes("AppliedWeightedBytes", cc), appliedMutations("AppliedMutations", cc), - appliedAtomicOps("AppliedAtomicOps", cc), appliedTxns("AppliedTxns", cc) {} + appliedAtomicOps("AppliedAtomicOps", cc), appliedTxns("AppliedTxns", cc), fetchKeys("FetchKeys", cc) {} } counters; void addref() { return ReferenceCounted::addref(); } diff --git a/fdbserver/RestoreCommon.actor.h b/fdbserver/RestoreCommon.actor.h index 6c2f618349..1baaea1c37 100644 --- a/fdbserver/RestoreCommon.actor.h +++ b/fdbserver/RestoreCommon.actor.h @@ -45,8 +45,6 @@ // TODO: Merge this RestoreConfig with the original RestoreConfig in FileBackupAgent.actor.cpp // For convenience typedef FileBackupAgent::ERestoreState ERestoreState; -// template <> Tuple Codec::pack(ERestoreState const& val); -// template <> ERestoreState Codec::unpack(Tuple const& val); template<> inline Tuple Codec::pack(ERestoreState const &val) { return Tuple().append(val); } template<> inline ERestoreState Codec::unpack(Tuple const &val) { return (ERestoreState)val.getInt(0); } @@ -365,4 +363,4 @@ Future sendBatchRequests(RequestStream Interface::*channel, std:: } #include "flow/unactorcompiler.h" -#endif // FDBCLIENT_Restore_H \ No newline at end of file +#endif // FDBSERVER_RESTORECOMMON_ACTOR_H \ No newline at end of file