]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/pg: update PG stats on handle_rep_op 58510/head
authorsajibreadd <sajibreadd@gmail.com>
Wed, 10 Jul 2024 12:27:02 +0000 (18:27 +0600)
committersajibreadd <sajibreadd@gmail.com>
Thu, 11 Jul 2024 11:31:48 +0000 (17:31 +0600)
Fixes: https://tracker.ceph.com/issues/61761
Signed-off-by: Md Mahamudur Rahaman Sajib <mahamudur.sajib@croit.io>
src/crimson/osd/pg.cc
src/crimson/osd/pg.h
src/crimson/osd/replicated_backend.cc

index 6cb3b6f05364970fd485e1345072dceddf43c0aa..bd1110e02ec4dc6c786e414ef4a49b023d9191d0 100644 (file)
@@ -1366,6 +1366,15 @@ PG::with_locked_obc(const hobject_t &hobj,
   };
 }
 
+void PG::update_stats(const pg_stat_t &stat) {
+  peering_state.update_stats(
+    [&stat] (auto& history, auto& stats) {
+      stats = stat;
+      return false;
+    }
+  );
+}
+
 PG::interruptible_future<> PG::handle_rep_op(Ref<MOSDRepOp> req)
 {
   if (__builtin_expect(stopping, false)) {
@@ -1384,6 +1393,7 @@ PG::interruptible_future<> PG::handle_rep_op(Ref<MOSDRepOp> req)
   auto p = req->logbl.cbegin();
   std::vector<pg_log_entry_t> log_entries;
   decode(log_entries, p);
+  update_stats(req->pg_stats);
   log_operation(std::move(log_entries),
                 req->pg_trim_to,
                 req->version,
index ec6bb78fa4e9e064a29734993ae76d7cd2a4132d..1db6410afd942f8bdef7ccb98494ba8adc305332 100644 (file)
@@ -517,6 +517,7 @@ public:
     with_obc_func_t&& f);
 
   interruptible_future<> handle_rep_op(Ref<MOSDRepOp> m);
+  void update_stats(const pg_stat_t &stat);
   void log_operation(
     std::vector<pg_log_entry_t>&& logv,
     const eversion_t &trim_to,
index 1fc59b7d9a03ae2e84647f7813ff26d7ebed07bd..d01fd6468034a3f59d3a0869593beec8345e461f 100644 (file)
@@ -70,6 +70,7 @@ ReplicatedBackend::_submit_transaction(std::set<pg_shard_t>&& pg_shards,
       encode(log_entries, m->logbl);
       m->pg_trim_to = osd_op_p.pg_trim_to;
       m->min_last_complete_ondisk = osd_op_p.min_last_complete_ondisk;
+      m->pg_stats = pg.get_info().stats;
       // TODO: set more stuff. e.g., pg_states
       sends->emplace_back(
        shard_services.send_to_osd(