From f3ee60b10bf6a1e2bcfd7ca825b310efc69d5af6 Mon Sep 17 00:00:00 2001 From: Xiaoxi Wang Date: Mon, 20 Jul 2020 03:17:46 +0000 Subject: [PATCH] slight change --- fdbclient/TagThrottle.h | 5 +++- .../workloads/WriteTagThrottling.actor.cpp | 2 ++ tests/CMakeLists.txt | 2 +- tests/WriteTagThrottling.txt | 25 ------------------- 4 files changed, 7 insertions(+), 27 deletions(-) delete mode 100644 tests/WriteTagThrottling.txt diff --git a/fdbclient/TagThrottle.h b/fdbclient/TagThrottle.h index 6403f22692..8c5c4e1317 100644 --- a/fdbclient/TagThrottle.h +++ b/fdbclient/TagThrottle.h @@ -54,7 +54,10 @@ public: const_iterator end() const { return tags.end(); } - + void clear() { + tags.clear(); + bytes = 0; + } //private: Arena arena; std::set tags; diff --git a/fdbserver/workloads/WriteTagThrottling.actor.cpp b/fdbserver/workloads/WriteTagThrottling.actor.cpp index 8a39f2199d..d18c538cee 100644 --- a/fdbserver/workloads/WriteTagThrottling.actor.cpp +++ b/fdbserver/workloads/WriteTagThrottling.actor.cpp @@ -212,6 +212,7 @@ struct WriteTagThrottlingWorkload : KVWorkload { state int i; // give tag to client if (self->writeThrottle) { + tr.options.tags.clear(); if (isBadActor) { tr.options.tags.addTag(self->badWriteTag); tr.options.tags.addTag(self->badReadTag); @@ -219,6 +220,7 @@ struct WriteTagThrottlingWorkload : KVWorkload { tr.options.tags.addTag(self->goodTag); } } + trStart = now(); while (true) { try { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e878196f71..e301555981 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -104,7 +104,7 @@ if(WITH_PYTHON) add_fdb_test(TEST_FILES pt.TXT IGNORE) add_fdb_test(TEST_FILES randomSelector.txt IGNORE) add_fdb_test(TEST_FILES selectorCorrectness.txt IGNORE) - add_fdb_test(TEST_FILES WriteTagThrottling.txt IGNORE) + add_fdb_test(TEST_FILES fast/WriteTagThrottling.txt) add_fdb_test(TEST_FILES fast/AtomicBackupCorrectness.txt) add_fdb_test(TEST_FILES fast/AtomicBackupToDBCorrectness.txt) add_fdb_test(TEST_FILES fast/AtomicOps.txt) diff --git a/tests/WriteTagThrottling.txt b/tests/WriteTagThrottling.txt deleted file mode 100644 index 721b575a1f..0000000000 --- a/tests/WriteTagThrottling.txt +++ /dev/null @@ -1,25 +0,0 @@ -testTitle=withoutWriteThrottling - testName=WriteTagThrottling - trPerSecond=10000000 - keyCount=5000 - absentFrac=0.01 - numWritePerTr=1 - numReadPerTr=1 - numClearPerTr=1 - badOpRate = 0.9 - - testName=HealthMetricsApi - -testTitle=withWriteThrottling - testName=WriteTagThrottling - writeThrottle = true - trPerSecond=10000000 - keyCount=5000 - absentFrac=0.01 - numWritePerTr=1 - numReadPerTr=1 - numClearPerTr=1 - badOpRate = 0.9 - tpsRate=20 - - testName=HealthMetricsApi