From cbc821c25b448ae55c57cdffcb7aaf1c71a52707 Mon Sep 17 00:00:00 2001 From: Aaron Gao Date: Tue, 30 May 2017 16:33:26 -0700 Subject: [PATCH] change regression rebuild to one level Summary: abandon fillseqdeterministic test locally Closes https://github.com/facebook/rocksdb/pull/2290 Differential Revision: D5151867 Pulled By: lightmark fbshipit-source-id: 4c8a24cc937212ffb5ceb9bfaf7288eb8726d0c1 --- tools/db_bench_tool.cc | 12 ++++++++++++ tools/regression_test.sh | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 3fce93694c..4252046545 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -97,6 +97,7 @@ DEFINE_string( "readseq," "readreverse," "compact," + "compactall," "readrandom," "multireadrandom," "readseq," @@ -2420,6 +2421,8 @@ void VerifyDBFromDB(std::string& truth_db_name) { method = &Benchmark::WriteSeqSeekSeq; } else if (name == "compact") { method = &Benchmark::Compact; + } else if (name == "compactall") { + CompactAll(); } else if (name == "crc32c") { method = &Benchmark::Crc32c; } else if (name == "xxhash") { @@ -5049,6 +5052,15 @@ void VerifyDBFromDB(std::string& truth_db_name) { db->CompactRange(CompactRangeOptions(), nullptr, nullptr); } + void CompactAll() { + if (db_.db != nullptr) { + db_.db->CompactRange(CompactRangeOptions(), nullptr, nullptr); + } + for (const auto& db_with_cfh : multi_dbs_) { + db_with_cfh.db->CompactRange(CompactRangeOptions(), nullptr, nullptr); + } + } + void ResetStats() { if (db_.db != nullptr) { db_.db->ResetStats(); diff --git a/tools/regression_test.sh b/tools/regression_test.sh index 416b6b40f5..82a94c4de9 100755 --- a/tools/regression_test.sh +++ b/tools/regression_test.sh @@ -129,11 +129,11 @@ function main { tmp=$DB_PATH DB_PATH=$ORIGIN_PATH test_remote "test -d $DB_PATH" - if [[ $? -ne 0 ]] || [[ $(run_remote 'date +%u') -eq 7 && - $(run_remote 'echo $(( $(date +"%s") - $(stat -c "%Y" '"$DB_PATH"') ))') -gt "86400" ]]; then + if [[ $? -ne 0 ]]; then run_remote "rm -rf $DB_PATH" echo "Building DB..." - run_db_bench "fillseqdeterministic" $NUM_KEYS 1 0 + run_db_bench "fillseq" $NUM_KEYS 1 0 + run_db_bench "compactall" fi DB_PATH=$tmp fi