From: Greg Farnum Date: Thu, 10 Feb 2011 21:23:44 +0000 (-0800) Subject: MDS: Don't always _commit_full just because we have a complete dir. X-Git-Tag: v0.25~135 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fa4a9230c6ba68b9b66d1560abb89114caedf74b;p=ceph.git MDS: Don't always _commit_full just because we have a complete dir. Instead, commit if a certain percentage of the dentries are dirty. Configurable via mds_dir_commit_ratio! Signed-off-by: Greg Farnum --- diff --git a/src/config.cc b/src/config.cc index b4411c7bf90f..0d593854bd43 100644 --- a/src/config.cc +++ b/src/config.cc @@ -355,6 +355,7 @@ static struct config_option config_optionsp[] = { OPTION(mds_cache_size, 0, OPT_INT, 100000), OPTION(mds_cache_mid, 0, OPT_FLOAT, .7), OPTION(mds_mem_max, 0, OPT_INT, 1048576), // KB + OPTION(mds_dir_commit_ratio, 0, OPT_FLOAT, .5), OPTION(mds_decay_halflife, 0, OPT_FLOAT, 5), OPTION(mds_beacon_interval, 0, OPT_FLOAT, 4), OPTION(mds_beacon_grace, 0, OPT_FLOAT, 15), diff --git a/src/config.h b/src/config.h index 317c10ca204f..29b1c3120745 100644 --- a/src/config.h +++ b/src/config.h @@ -233,6 +233,7 @@ struct md_config_t { int mds_cache_size; float mds_cache_mid; int mds_mem_max; + float mds_dir_commit_ratio; float mds_decay_halflife; diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index d3b0b88ff5a1..8c720b54fc2c 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -1744,7 +1744,8 @@ void CDir::_commit(version_t want) } ObjectOperation m; - if (is_complete()) { + if (is_complete() && + (num_dirty > (num_head_items*g_conf.mds_dir_commit_ratio))) { fnode.snap_purged_thru = realm->get_last_destroyed(); _commit_full(m, snaps); } else {