diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 3fce93694..425204654 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 416b6b40f..82a94c4de 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