From cf5adc80164ff750bf4bf1f5df909746c665cf01 Mon Sep 17 00:00:00 2001 From: Dhruba Borthakur Date: Fri, 19 Oct 2012 12:16:18 -0700 Subject: [PATCH] db_bench was not correctly initializing the value for delete_obsolete_files_period_micros option. Summary: The parameter delete_obsolete_files_period_micros controls the periodicity of deleting obsolete files. db_bench was reading in this parameter intoa local variable called 'l' but was incorrectly using another local variable called 'n' while setting it in the db.options data structure. This patch also logs the value of delete_obsolete_files_period_micros in the LOG file at db startup time. I am hoping that this will improve the overall write throughput drastically. Test Plan: run db_bench Reviewers: MarkCallaghan, heyongqiang Reviewed By: MarkCallaghan Differential Revision: https://reviews.facebook.net/D6099 --- db/db_bench.cc | 2 +- util/options.cc | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/db/db_bench.cc b/db/db_bench.cc index 623c72ecb..485536da8 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -1299,7 +1299,7 @@ int main(int argc, char** argv) { FLAGS_disable_seek_compaction = n; } else if (sscanf(argv[i], "--delete_obsolete_files_period_micros=%ld%c", &l, &junk) == 1) { - FLAGS_delete_obsolete_files_period_micros = n; + FLAGS_delete_obsolete_files_period_micros = l; } else if (sscanf(argv[i], "--stats_interval=%d%c", &n, &junk) == 1 && n >= 0 && n < 2000000000) { FLAGS_stats_interval = n; diff --git a/util/options.cc b/util/options.cc index 8078b4db1..e4f8cfa7c 100644 --- a/util/options.cc +++ b/util/options.cc @@ -89,10 +89,12 @@ Options::Dump( expanded_compaction_factor); Log(log," Options.max_grandparent_overlap_factor: %d", max_grandparent_overlap_factor); - Log(log," Options.db_log_dir: %s", + Log(log," Options.db_log_dir: %s", db_log_dir.c_str()); - Log(log," Options.disable_seek_compaction: %d", + Log(log," Options.disable_seek_compaction: %d", disable_seek_compaction); + Log(log," Options.delete_obsolete_files_period_micros: %ld", + delete_obsolete_files_period_micros); } // Options::Dump