From: Sage Weil Date: Sat, 2 May 2015 00:22:57 +0000 (-0700) Subject: os/newstore: queue kv transactions in kv_sync_thread X-Git-Tag: v9.1.0~242^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=92979d750b6021726b9364a7a7c0925002009f76;p=ceph.git 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 --- diff --git a/src/os/newstore/NewStore.cc b/src/os/newstore/NewStore.cc index 044f1ebe3917..5a5f730ad860 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();