diff options
author | Sage Weil <sage@inktank.com> | 2013-01-18 15:23:22 -0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-01-18 15:44:41 -0800 |
commit | 5e00af406b89c9817e9a429f92a05ca9c29b19c3 (patch) | |
tree | f5da1f2552cbea4af6de4c7f0bb26903a97b0258 | |
parent | 4712e984d3f62cdf51ea67da8197eed18a5983dd (diff) | |
download | ceph-5e00af406b89c9817e9a429f92a05ca9c29b19c3.tar.gz |
osd: set pg removal transactions based on configurable
Use the osd_target_transaction_size knob, and gracefully tolerate bogus
values (e.g., <= 0).
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/osd/OSD.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index c1027adf112..6bad8a2f9ed 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2301,17 +2301,18 @@ void OSD::RemoveWQ::_process(boost::tuple<coll_t, SequencerRef, DeletingStateRef vector<hobject_t> olist; store->collection_list(coll, olist); //*_dout << "OSD::RemoveWQ::_process removing coll " << coll << std::endl; - uint64_t num = 1; + int64_t num = 0; ObjectStore::Transaction *t = new ObjectStore::Transaction; for (vector<hobject_t>::iterator i = olist.begin(); i != olist.end(); ++i, ++num) { - if (num % 20 == 0) { + t->remove(coll, *i); + if (num >= g_conf->osd_target_transaction_size) { store->apply_transaction(osr, *t); delete t; t = new ObjectStore::Transaction; + num = 0; } - t->remove(coll, *i); } t->remove_collection(coll); store->apply_transaction(*t); |