From 05ebfebc177418a29acbb88a66c0b02058150a2a Mon Sep 17 00:00:00 2001 From: Zhichao Cao Date: Fri, 8 Mar 2019 14:07:19 -0800 Subject: [PATCH] Fixed the potential stack overflow of MixGraph in db_bench (#5051) Summary: In the MixGraph benchmark of db_bench, The max buffer size used for value of KV-pair might be extremely large (64MB), which might cause function stack overflow in some platforms, reduced to 1MB. Added the finished ops printing in MixGraph benchmark. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5051 Differential Revision: D14379571 Pulled By: zhichao-cao fbshipit-source-id: 24084fbe38f60f2902d9a40f6bc9a25e4e2c9bb9 --- tools/db_bench_tool.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 445e12134..ed969c0de 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -4709,7 +4709,7 @@ void VerifyDBFromDB(std::string& truth_db_name) { int64_t seek = 0; int64_t seek_found = 0; int64_t bytes = 0; - const int64_t default_value_max = 64 * 1024 * 1024; + const int64_t default_value_max = 1 * 1024 * 1024; int64_t value_max = default_value_max; int64_t scan_len_max = FLAGS_mix_max_scan_len; double write_rate = 1000000.0; @@ -4807,7 +4807,7 @@ void VerifyDBFromDB(std::string& truth_db_name) { 256, Env::IO_HIGH, nullptr /* stats */, RateLimiter::OpType::kRead); } - + thread->stats.FinishedOps(db_with_cfh, db_with_cfh->db, 1, kRead); } else if (query_type == 1) { // the Put query puts++; @@ -4831,7 +4831,7 @@ void VerifyDBFromDB(std::string& truth_db_name) { key.size() + value_size, Env::IO_HIGH, nullptr /*stats*/, RateLimiter::OpType::kWrite); } - + thread->stats.FinishedOps(db_with_cfh, db_with_cfh->db, 1, kWrite); } else if (query_type == 2) { // Seek query if (db_with_cfh->db != nullptr) { @@ -4859,6 +4859,7 @@ void VerifyDBFromDB(std::string& truth_db_name) { } delete single_iter; } + thread->stats.FinishedOps(db_with_cfh, db_with_cfh->db, 1, kSeek); } } char msg[256]; -- GitLab