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)
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);