From: xie xingguo Date: Tue, 23 Feb 2016 07:39:56 +0000 (+0800) Subject: osd: fix wrong counter for batch objects removal during remove_dir() X-Git-Tag: v10.1.0~42^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1ea1735df501e1d1af126d8fb3855cca77ce07e5;p=ceph.git osd: fix wrong counter for batch objects removal during remove_dir() The problem here is that we may skip some meta objects which shall not be counted since they are not really queued. Besides, the counter itself is not very accurate, e.g., if we set osd_target_transaction_size to 30, we may actually queue 31 transactions to trigger a commit. Signed-off-by: xie xingguo --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 874dd38c1737..500ad777479d 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4486,7 +4486,7 @@ bool remove_dir( &next); for (vector::iterator i = olist.begin(); i != olist.end(); - ++i, ++num) { + ++i) { if (i->is_pgmeta()) continue; OSDriver::OSTransaction _t(osdriver->get_transaction(&t)); @@ -4495,7 +4495,7 @@ bool remove_dir( assert(0); } t.remove(coll, *i); - if (num >= cct->_conf->osd_target_transaction_size) { + if (++num >= cct->_conf->osd_target_transaction_size) { C_SaferCond waiter; store->queue_transaction(osr, std::move(t), &waiter); bool cont = dstate->pause_clearing();