]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/newstore: make sync/async submit_transaction optional
authorSage Weil <sage@redhat.com>
Mon, 4 May 2015 18:05:27 +0000 (11:05 -0700)
committerSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:39:43 +0000 (13:39 -0400)
It seems doing this synchronously may be better for SSDs?

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_opts.h
src/os/newstore/NewStore.cc

index b83fef4f83023139962f7ded0792adba8aae42f4..efb0d66207349959e4b7eff9730c9c0557dce168 100644 (file)
@@ -796,6 +796,7 @@ OPTION(newstore_backend, OPT_STR, "rocksdb")
 OPTION(newstore_fail_eio, OPT_BOOL, true)
 OPTION(newstore_sync_io, OPT_BOOL, false)  // perform initial io synchronously
 OPTION(newstore_sync_transaction, OPT_BOOL, false)  // perform kv txn synchronously
+OPTION(newstore_sync_submit_transaction, OPT_BOOL, false)
 OPTION(newstore_sync_wal_apply, OPT_BOOL, true)     // perform initial wal work synchronously (possibly in combination with aio so we only *queue* ios)
 OPTION(newstore_fsync_threads, OPT_INT, 16)  // num threads calling fsync
 OPTION(newstore_fsync_thread_timeout, OPT_INT, 30) // thread timeout value
index 26a93722ba1eeb297fe4307af5b67f06552c7725..7667bd266fabaca2ccf6bd4c49e6c27366cc42c4 100644 (file)
@@ -2084,6 +2084,9 @@ void NewStore::_txc_state_proc(TransContext *txc)
       txc->state = TransContext::STATE_KV_QUEUED;
       if (!g_conf->newstore_sync_transaction) {
        Mutex::Locker l(kv_lock);
+       if (g_conf->newstore_sync_submit_transaction) {
+         db->submit_transaction(txc->t);
+       }
        kv_queue.push_back(txc);
        kv_cond.SignalOne();
        return;
@@ -2383,10 +2386,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);
+      if (!g_conf->newstore_sync_submit_transaction) {
+       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