]> 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>
Wed, 23 Jan 2013 13:39:01 +0000 (05:39 -0800)
Use the osd_target_transaction_size knob, and gracefully tolerate bogus
values (e.g., <= 0).

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 5e00af406b89c9817e9a429f92a05ca9c29b19c3)

src/osd/OSD.cc

index 8027c654d4131f13e791aa3a2932930398339e64..3ffa6078c6d76d17538011725dcb5b6e438e4fdf 100644 (file)
@@ -2304,17 +2304,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);