{
std::lock_guard l(kv_lock);
kv_queue.push_back(txc);
- kv_cond.notify_one();
+ if (!kv_sync_in_progress) {
+ kv_sync_in_progress = true;
+ kv_cond.notify_one();
+ }
if (txc->state != TransContext::STATE_KV_SUBMITTED) {
kv_queue_unsubmitted.push_back(txc);
++txc->osr->kv_committing_serially;
{
// wake up any previously finished deferred events
std::lock_guard l(kv_lock);
- kv_cond.notify_one();
+ if (!kv_sync_in_progress) {
+ kv_sync_in_progress = true;
+ kv_cond.notify_one();
+ }
}
osr->drain_preceding(txc);
--deferred_aggressive;
{
// wake up any previously finished deferred events
std::lock_guard l(kv_lock);
- kv_cond.notify_one();
+ if (!kv_sync_in_progress) {
+ kv_sync_in_progress = true;
+ kv_cond.notify_one();
+ }
}
osr->drain();
--deferred_aggressive;
if (kv_stop)
break;
dout(20) << __func__ << " sleep" << dendl;
+ kv_sync_in_progress = false;
kv_cond.wait(l);
dout(20) << __func__ << " wake" << dendl;
} else {
// catch us on the next commit anyway.
if (deferred_aggressive) {
std::lock_guard l(kv_lock);
- kv_cond.notify_one();
+ if (!kv_sync_in_progress) {
+ kv_sync_in_progress = true;
+ kv_cond.notify_one();
+ }
}
}
{
// wake up any previously finished deferred events
std::lock_guard l(kv_lock);
- kv_cond.notify_one();
+ if (!kv_sync_in_progress) {
+ kv_sync_in_progress = true;
+ kv_cond.notify_one();
+ }
}
throttle_deferred_bytes.get(txc->cost);
--deferred_aggressive;
deque<TransContext*> kv_queue_unsubmitted; ///< ready, need submit by kv thread
deque<TransContext*> kv_committing; ///< currently syncing
deque<DeferredBatch*> deferred_done_queue; ///< deferred ios done
+ bool kv_sync_in_progress = false;
KVFinalizeThread kv_finalize_thread;
ceph::mutex kv_finalize_lock = ceph::make_mutex("BlueStore::kv_finalize_lock");