From 92979d750b6021726b9364a7a7c0925002009f76 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 1 May 2015 17:22:57 -0700 Subject: [PATCH] os/newstore: queue kv transactions in kv_sync_thread It appears that db->submit_transaction() will block if there is a sync commit that is in progress instead of simply queueing the new txn for later. To work around this, submit these to the backend in the kv_sync_thread prior to the synchronous submit_transaction_sync(). Signed-off-by: Sage Weil --- src/os/newstore/NewStore.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/os/newstore/NewStore.cc b/src/os/newstore/NewStore.cc index 044f1ebe39176..5a5f730ad8605 100644 --- a/src/os/newstore/NewStore.cc +++ b/src/os/newstore/NewStore.cc @@ -2084,7 +2084,6 @@ void NewStore::_txc_state_proc(TransContext *txc) txc->state = TransContext::STATE_KV_QUEUED; if (!g_conf->newstore_sync_transaction) { Mutex::Locker l(kv_lock); - db->submit_transaction(txc->t); kv_queue.push_back(txc); kv_cond.SignalOne(); return; @@ -2384,6 +2383,12 @@ void NewStore::_kv_sync_thread() utime_t start = ceph_clock_now(NULL); kv_lock.Unlock(); + for (std::deque::iterator it = kv_committing.begin(); + it != kv_committing.end(); + it++) { + db->submit_transaction((*it)->t); + } + // one transaction to force a sync. clean up wal keys while we // are at it. KeyValueDB::Transaction txc_cleanup_sync = db->get_transaction(); -- 2.39.5