Basically we don't allow a transaction to get too big, e.g., to
avoid contiguously occupation of CPU.
We break and queue the transaction here whenever we have collected
osd_target_transaction_size temp objects.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
}
if (!temps.empty()) {
ObjectStore::Transaction t;
+ int removed = 0;
for (vector<ghobject_t>::iterator q = temps.begin(); q != temps.end(); ++q) {
dout(20) << " removing " << *p << " object " << *q << dendl;
t.remove(*p, *q);
+ if (++removed > cct->_conf->osd_target_transaction_size) {
+ store->apply_transaction(service.meta_osr.get(), std::move(t));
+ t = ObjectStore::Transaction();
+ removed = 0;
+ }
+ }
+ if (removed) {
+ store->apply_transaction(service.meta_osr.get(), std::move(t));
}
- store->apply_transaction(service.meta_osr.get(), std::move(t));
}
}
}