If we take the aio path, the io is queued immediately and the resources
are released back to the pool. Instead release them when wal completes.
Signed-off-by: Sage Weil <sage@redhat.com>
wal_transaction_t& wt = *txc->wal_txn;
dout(20) << __func__ << " txc " << " seq " << wt.seq << txc << dendl;
+ wal_wq.release_throttle(txc);
+
string key;
get_wal_key(wt.seq, &key);
KeyValueDB::Transaction cleanup = db->get_transaction();
// requeue at the end to minimize contention
wal_queue.push_back(*i->osr);
}
- --ops;
- bytes -= i->wal_txn->get_bytes();
- throttle_cond.Signal();
// preserve wal ordering for this sequencer by taking the lock
// while still holding the queue lock
throttle_cond.Wait(lock);
}
}
+
+ void release_throttle(TransContext *txc) {
+ lock();
+ --ops;
+ bytes -= txc->wal_txn->get_bytes();
+ throttle_cond.Signal();
+ unlock();
+ }
};
struct KVSyncThread : public Thread {