From 31b5aec88e424bf4652269358fbb67dafa9ed8de Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 31 Jan 2018 10:48:20 -0600 Subject: [PATCH] os/filestore: do not rely on ObjectStore::Transaction::osr This was used only to name the osr for the purposes of the tracepoint. We can do that ourselves! Signed-off-by: Sage Weil --- src/os/filestore/FileStore.cc | 15 ++++++--------- src/os/filestore/FileStore.h | 13 +++++++++---- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/os/filestore/FileStore.cc b/src/os/filestore/FileStore.cc index 02494010a39fc..c50588fdb36ce 100644 --- a/src/os/filestore/FileStore.cc +++ b/src/os/filestore/FileStore.cc @@ -2119,7 +2119,7 @@ void FileStore::_do_op(OpSequencer *osr, ThreadPool::TPHandle &handle) apply_manager.op_apply_start(o->op); dout(5) << __FUNC__ << ": " << o << " seq " << o->op << " " << *osr << " start" << dendl; o->trace.event("_do_transactions start"); - int r = _do_transactions(o->tls, o->op, &handle); + int r = _do_transactions(o->tls, o->op, &handle, osr->osr_name); o->trace.event("op_apply_finish"); apply_manager.op_apply_finish(o->op); dout(10) << __FUNC__ << ": " << o << " seq " << o->op << " r = " << r @@ -2364,14 +2364,15 @@ void FileStore::_journaled_ahead(OpSequencer *osr, Op *o, Context *ondisk) int FileStore::_do_transactions( vector &tls, uint64_t op_seq, - ThreadPool::TPHandle *handle) + ThreadPool::TPHandle *handle, + const char *osr_name) { int trans_num = 0; for (vector::iterator p = tls.begin(); p != tls.end(); ++p, trans_num++) { - _do_transaction(*p, op_seq, trans_num, handle); + _do_transaction(*p, op_seq, trans_num, handle, osr_name); if (handle) handle->reset_tp_timeout(); } @@ -2651,15 +2652,11 @@ int FileStore::_check_replay_guard(int fd, const SequencerPosition& spos) void FileStore::_do_transaction( Transaction& t, uint64_t op_seq, int trans_num, - ThreadPool::TPHandle *handle) + ThreadPool::TPHandle *handle, + const char *osr_name) { dout(10) << __FUNC__ << ": on " << &t << dendl; -#ifdef WITH_LTTNG - string osr_name_str = stringify(static_cast(t.get_osr())->cid); - const char *osr_name = osr_name_str.c_str(); -#endif - Transaction::iterator i = t.begin(); SequencerPosition spos(op_seq, trans_num, 0); diff --git a/src/os/filestore/FileStore.h b/src/os/filestore/FileStore.h index d401909b62847..861d6d4c33e9d 100644 --- a/src/os/filestore/FileStore.h +++ b/src/os/filestore/FileStore.h @@ -229,9 +229,11 @@ private: list jq; list > flush_commit_waiters; Cond cond; + string osr_name_str; public: Mutex apply_lock; // for apply mutual exclusion int id; + const char *osr_name; /// get_max_uncompleted bool _get_max_uncompleted( @@ -351,8 +353,10 @@ private: : CollectionImpl(cid), cct(cct), qlock("FileStore::OpSequencer::qlock", false, false), + osr_name_str(stringify(cid)), apply_lock("FileStore::OpSequencer::apply_lock", false, false), - id(i) {} + id(i), + osr_name(osr_name_str.c_str()) {} ~OpSequencer() override { assert(q.empty()); } @@ -511,13 +515,14 @@ public: int _do_transactions( vector &tls, uint64_t op_seq, - ThreadPool::TPHandle *handle); + ThreadPool::TPHandle *handle, + const char *osr_name); int do_transactions(vector &tls, uint64_t op_seq) override { - return _do_transactions(tls, op_seq, 0); + return _do_transactions(tls, op_seq, nullptr, "replay"); } void _do_transaction( Transaction& t, uint64_t op_seq, int trans_num, - ThreadPool::TPHandle *handle); + ThreadPool::TPHandle *handle, const char *osr_name); CollectionHandle open_collection(const coll_t& c) override; CollectionHandle create_new_collection(const coll_t& c) override; -- 2.39.5