]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/newstore: queue kv transactions in kv_sync_thread
authorSage Weil <sage@redhat.com>
Sat, 2 May 2015 00:22:57 +0000 (17:22 -0700)
committerSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:39:42 +0000 (13:39 -0400)
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 <sage@redhat.com>
src/os/newstore/NewStore.cc

index 044f1ebe391765d4b24565df947fb689675e08c1..5a5f730ad86058ffe92086bddc339747fb4bb745 100644 (file)
@@ -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<TransContext *>::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();