From: Sage Weil Date: Mon, 4 May 2015 18:05:27 +0000 (-0700) Subject: os/newstore: make sync/async submit_transaction optional X-Git-Tag: v9.1.0~242^2~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8ad6b9dfc3d9b0c8d2003cf6b5752989faecae2e;p=ceph.git os/newstore: make sync/async submit_transaction optional It seems doing this synchronously may be better for SSDs? Signed-off-by: Sage Weil --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index b83fef4f8302..efb0d6620734 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -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 diff --git a/src/os/newstore/NewStore.cc b/src/os/newstore/NewStore.cc index 26a93722ba1e..7667bd266fab 100644 --- a/src/os/newstore/NewStore.cc +++ b/src/os/newstore/NewStore.cc @@ -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::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::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