kv_cond.Wait(kv_lock);
dout(20) << __func__ << " wake" << dendl;
} else {
- dout(20) << __func__ << " committing " << kv_queue.size() << " cleaning " << wal_cleanup_queue.size() << dendl;
+ dout(20) << __func__ << " committing " << kv_queue.size()
+ << " cleaning " << wal_cleanup_queue.size() << dendl;
kv_committing.swap(kv_queue);
wal_cleaning.swap(wal_cleanup_queue);
utime_t start = ceph_clock_now(NULL);
kv_lock.Unlock();
+
+ // one transaction to force a sync. clean up wal keys while we
+ // are at it.
KeyValueDB::Transaction txc_cleanup_sync = db->get_transaction();
- //adding wal cleanup op
for (std::deque<TransContext *>::iterator it = wal_cleaning.begin();
it != wal_cleaning.end();
it++) {
get_wal_key(wt.seq, &key);
txc_cleanup_sync->rmkey(PREFIX_WAL, key);
}
-
db->submit_transaction_sync(txc_cleanup_sync);
utime_t finish = ceph_clock_now(NULL);
utime_t dur = finish - start;
- dout(20) << __func__ << " committed " << kv_committing.size() << "cleaned " << wal_cleaning.size()
+ dout(20) << __func__ << " committed " << kv_committing.size()
+ << " cleaned " << wal_cleaning.size()
<< " in " << dur << dendl;
while (!kv_committing.empty()) {
TransContext *txc = kv_committing.front();