From 15a4dbcc5b1635796db7f5c8e2f874d20caca639 Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Mon, 18 Jul 2022 11:45:06 +0530 Subject: [PATCH] mds: add counters for uninlining Signed-off-by: Milind Changire --- src/mds/MDCache.cc | 20 +++++++++++++++++--- src/mds/MDCache.h | 6 ++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index ab5f9c9610580..ec4acae330311 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -13186,11 +13186,14 @@ class C_MDC_DataUninlinedSubmitted : public MDCacheLogContext { auto mds = get_mds(); // to keep dout happy auto in = mds->server->rdlock_path_pin_ref(mdr, true); + ceph_assert(in != nullptr); + if (r) { dout(20) << "(uninline_data) log submission failed; r=" << r - << " (" << cpp_strerror(r) << ")" << dendl; + << " (" << cpp_strerror(r) << ") for " << *in << dendl; } else { - dout(20) << "(uninline_data) log submission succeeded" << dendl; + dout(20) << "(uninline_data) log submission succeeded for " << *in << dendl; + in->mdcache->logger->inc(l_mdc_uninline_succeeded); } mdr->apply(); @@ -13215,7 +13218,8 @@ struct C_IO_DataUninlined : public MDSIOContext { // return faster if operation has failed (non-zero) status if (r) { derr << "(uninline_data) mutation failed: r=" << r - << "(" << cpp_strerror(r) << ")" << dendl; + << " (" << cpp_strerror(r) << ") for " << *in << dendl; + in->mdcache->logger->inc(l_mdc_uninline_write_failed); mds->server->respond_to_request(mdr, r); return; } @@ -13279,6 +13283,8 @@ void MDCache::uninline_data_work(MDRequestRef mdr) return; } + logger->inc(l_mdc_uninline_started); + auto ino = [&]() { return in->ino(); }; auto pi = in->get_projected_inode(); auto objecter = mds->objecter; @@ -13706,6 +13712,14 @@ void MDCache::register_perfcounters() pcb.add_u64_counter(l_mdss_ireq_inodestats, "ireq_inodestats", "Internal Request type inode stats"); + // uninline op stats + pcb.add_u64_counter(l_mdc_uninline_started, "uninline_started", + "Internal Counter type uninline started"); + pcb.add_u64_counter(l_mdc_uninline_succeeded, "uninline_succeeded", + "Internal Counter type uninline succeeded"); + pcb.add_u64_counter(l_mdc_uninline_write_failed, "uninline_write_failed", + "Internal Counter type uninline write failed"); + logger.reset(pcb.create_perf_counters()); g_ceph_context->get_perfcounters_collection()->add(logger.get()); recovery_queue.set_logger(logger.get()); diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index c54d9e0cf287c..0b01c9ab8594c 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -118,6 +118,10 @@ enum { l_mdss_ireq_fragstats, l_mdss_ireq_inodestats, + l_mdc_uninline_started, + l_mdc_uninline_succeeded, + l_mdc_uninline_write_failed, + l_mdc_last, }; @@ -1444,6 +1448,8 @@ private: friend class C_MDC_FragmentCommit; friend class C_MDC_FragmentRollback; friend class C_IO_MDC_FragmentPurgeOld; + friend class C_IO_DataUninlined; + friend class C_MDC_DataUninlinedSubmitted; // -- subtrees -- static const unsigned int SUBTREES_COUNT_THRESHOLD = 5; -- 2.39.5