]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/CDir: set sane max keys per op
authorSage Weil <sage@redhat.com>
Fri, 20 Jan 2017 03:20:54 +0000 (21:20 -0600)
committerJohn Spray <john.spray@redhat.com>
Tue, 14 Mar 2017 11:51:25 +0000 (11:51 +0000)
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 <sage@redhat.com>
src/common/config_opts.h
src/mds/CDir.cc

index 2aa4f283b7eb9cc06029bfe737c7aa3dbc38eb2f..009eb2e21869f6ae263bdac9a22c0b6e21f0cb25 100644 (file)
@@ -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)
index fce581d73f3162c3fde6b64b0d87046111fc3561..cfb80b49958c161228ca444e5e2c5c661d81ab16 100644 (file)
@@ -1544,7 +1544,8 @@ void CDir::_omap_fetch(MDSInternalContextBase *c, const std::set<dentry_key_t>&
   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<std::string> 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);