From d7baef4ff88b1798cbd407c2dc08f9bd9f4f3b2f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 19 Jan 2017 21:20:54 -0600 Subject: [PATCH] mds/CDir: set sane max keys per op Set default to 16384, which is > than the max frag size of 10000. We will loop if there are more. Signed-off-by: Sage Weil --- src/common/config_opts.h | 1 + src/mds/CDir.cc | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 2aa4f283b7eb..009eb2e21869 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -492,6 +492,7 @@ OPTION(mds_cache_size, OPT_INT, 100000) OPTION(mds_cache_mid, OPT_FLOAT, .7) OPTION(mds_max_file_recover, OPT_U32, 32) OPTION(mds_dir_max_commit_size, OPT_INT, 10) // MB +OPTION(mds_dir_keys_per_op, OPT_INT, 16384) OPTION(mds_decay_halflife, OPT_FLOAT, 5) OPTION(mds_beacon_interval, OPT_FLOAT, 4) OPTION(mds_beacon_grace, OPT_FLOAT, 15) diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index fce581d73f31..cfb80b49958c 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -1544,7 +1544,8 @@ void CDir::_omap_fetch(MDSInternalContextBase *c, const std::set& rd.omap_get_header(&fin->hdrbl, &fin->ret1); if (keys.empty()) { assert(!c); - rd.omap_get_vals("", "", (uint64_t)-1, &fin->omap, &fin->more, &fin->ret2); + rd.omap_get_vals("", "", g_conf->mds_dir_keys_per_op, + &fin->omap, &fin->more, &fin->ret2); } else { assert(c); std::set str_keys; @@ -1581,7 +1582,7 @@ void CDir::_omap_fetch_more( ObjectOperation rd; rd.omap_get_vals(fin->omap.rbegin()->first, "", /* filter prefix */ - (uint64_t)-1, + g_conf->mds_dir_keys_per_op, &fin->omap_more, &fin->more, &fin->ret); -- 2.47.3