]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: apply stats after make_writeable
authorMatan Breizman <mbreizma@redhat.com>
Mon, 4 Jul 2022 09:48:18 +0000 (09:48 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Thu, 18 Aug 2022 10:59:26 +0000 (10:59 +0000)
make_writeable keeps track of few stats counters (e.g num_object_clones).
Therfore, we should apply the stats after it.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/ops_executer.cc
src/crimson/osd/ops_executer.h
src/crimson/osd/pg.cc

index df91f9bdfa10decf61c3d3c5a3f43f383b0a6517..7a9064de99d981275b20ffc37385c12009c9fe75 100644 (file)
@@ -832,6 +832,12 @@ const object_info_t OpsExecuter::prepare_clone(
   return static_snap_oi;
 }
 
+void OpsExecuter::apply_stats()
+{
+  pg->get_peering_state().apply_op_stats(get_target(), delta_stats);
+  pg->publish_stats_to_osd();
+}
+
 static inline std::unique_ptr<const PGLSFilter> get_pgls_filter(
   const std::string& type,
   bufferlist::const_iterator& iter)
index 0fdce7cefd7aafcf68f2affb23e3d213c97c28b6..58bdcba1419e811159df7f82f0f231906bbc2494 100644 (file)
@@ -324,6 +324,8 @@ public:
 
   const object_info_t prepare_clone(
     const hobject_t& coid);
+
+  void apply_stats();
 };
 
 template <class Context, class MainFunc, class EffectFunc>
@@ -381,6 +383,7 @@ OpsExecuter::flush_changes_n_do_ops_effects(
     fill_op_params_bump_pg_version();
     auto log_entries = prepare_transaction(ops);
     make_writeable(log_entries);
+    apply_stats();
     auto [submitted, all_completed] = std::forward<MutFunc>(mut_func)(std::move(txn),
                                                     std::move(obc),
                                                     std::move(*osd_op_params),
index da72e3d2b56a980914c0ebae6a67f2d6d217b1d2..92f9e8b6e46935b55282d25407649a4e3baca841 100644 (file)
@@ -648,8 +648,6 @@ PG::do_osd_ops_execute(
             crimson::ct_error::eagain::make()));
       }
     }
-
-    peering_state.apply_op_stats(ox->get_target(), ox->get_stats());
     return std::move(*ox).flush_changes_n_do_ops_effects(ops,
       [this] (auto&& txn,
               auto&& obc,