From 9318ec033dfa0616d8b5d769cca17483c23a41f5 Mon Sep 17 00:00:00 2001 From: Meng Xu Date: Sat, 20 Jun 2020 20:07:18 -0700 Subject: [PATCH] FastRestore:FixTest:Remove unnecessary read --- fdbserver/RestoreUtil.h | 4 ++-- .../BackupAndParallelRestoreCorrectness.actor.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fdbserver/RestoreUtil.h b/fdbserver/RestoreUtil.h index 3282d87a22..661c26608a 100644 --- a/fdbserver/RestoreUtil.h +++ b/fdbserver/RestoreUtil.h @@ -35,8 +35,8 @@ #include #include -#define SevFRMutationInfo SevVerbose -// #define SevFRMutationInfo SevInfo +//#define SevFRMutationInfo SevVerbose +#define SevFRMutationInfo SevInfo struct VersionedMutation { MutationRef mutation; diff --git a/fdbserver/workloads/BackupAndParallelRestoreCorrectness.actor.cpp b/fdbserver/workloads/BackupAndParallelRestoreCorrectness.actor.cpp index 7e69525348..d32fe2d8f9 100644 --- a/fdbserver/workloads/BackupAndParallelRestoreCorrectness.actor.cpp +++ b/fdbserver/workloads/BackupAndParallelRestoreCorrectness.actor.cpp @@ -351,13 +351,10 @@ struct BackupAndParallelRestoreCorrectnessWorkload : TestWorkload { oldData.push_back_deep(oldData.arena(), KeyValueRef(kv.key, kv.value)); } } - Standalone kvs = wait(tr.getRange(normalKeys, CLIENT_KNOBS->TOO_MANY)); - ASSERT(!kvs.more); - int i = 0; // Convert data by removePrefix and addPrefix in memory state Standalone> newKVs; - for (i = 0; i < oldData.size(); ++i) { + for (int i = 0; i < oldData.size(); ++i) { Key newKey(oldData[i].key); TraceEvent("TransformDatabaseContents") .detail("Keys", oldData.size()) @@ -371,7 +368,7 @@ struct BackupAndParallelRestoreCorrectnessWorkload : TestWorkload { continue; } newKey = newKey.removePrefix(removePrefix).withPrefix(addPrefix); - newKVs.push_back_deep(newKVs.arena(), KeyValueRef(newKey.contents(), kvs[i].value)); + newKVs.push_back_deep(newKVs.arena(), KeyValueRef(newKey.contents(), oldData[i].value)); TraceEvent("TransformDatabaseContents") .detail("Index", i) .detail("NewKey", newKVs.back().key) @@ -379,11 +376,11 @@ struct BackupAndParallelRestoreCorrectnessWorkload : TestWorkload { } // Clear the transformed data (original data with removePrefix and addPrefix) in restoreRanges - TraceEvent("TransformDatabaseContents").detail("Clear", normalKeys); wait(runRYWTransaction(cx, [=](Reference tr) -> Future { tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::LOCK_AWARE); for (auto& range : restoreRanges) { + TraceEvent("TransformDatabaseContents").detail("Clear", range); tr->clear(range); // Careful when we restore only a sub key range! } return Void(); @@ -639,6 +636,9 @@ struct BackupAndParallelRestoreCorrectnessWorkload : TestWorkload { KeyRange range(self->backupRanges[i]); Key begin = range.begin.removePrefix(self->removePrefix).withPrefix(self->addPrefix); Key end = range.end.removePrefix(self->removePrefix).withPrefix(self->addPrefix); + TraceEvent("FastRestoreWorkloadTransformDatabaseContents") + .detail("Begin", begin) + .detail("End", end); restoreRanges.push_back_deep(restoreRanges.arena(), KeyRangeRef(begin.contents(), end.contents())); }