]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: set pg removal transactions based on configurable
authorSage Weil <sage@inktank.com>
Fri, 18 Jan 2013 23:23:22 +0000 (15:23 -0800)
committerSage Weil <sage@inktank.com>
Fri, 18 Jan 2013 23:44:41 +0000 (15:44 -0800)
Use the osd_target_transaction_size knob, and gracefully tolerate bogus
values (e.g., <= 0).

Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/OSD.cc

index c1027adf11241d5d17f35ff4ca548a2375d71f39..6bad8a2f9ed7d7ab5580d41bb978146f02931438 100644 (file)
@@ -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);