]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: support long running ops without slow warnings
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 16 Nov 2023 17:36:25 +0000 (12:36 -0500)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 22 Mar 2024 15:38:01 +0000 (11:38 -0400)
A quiesce op in the MDS may run for an indeterminate amount of time. Warnings
should not be generated.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit c036b151465a2ecb8bf24943e1030988f7e6c6ce)

src/common/TrackedOp.cc
src/common/TrackedOp.h

index 0de21e38743ac2b22ddb753bdc11ab499c6bcf86..8de8c7d1ff410d82245c134e3c3427ffb2967057 100644 (file)
@@ -207,7 +207,7 @@ void OpHistory::dump_slow_ops(utime_t now, Formatter *f, set<string> filters)
   f->dump_int("threshold to keep", history_slow_op_threshold.load());
   {
     f->open_array_section("Ops");
-    for (const auto& [t, op] : slow_op) {
+    for ([[maybe_unused]] const auto& [t, op] : slow_op) {
       if (!op->filter_out(filters))
         continue;
       f->open_object_section("Op");
@@ -388,6 +388,9 @@ bool OpTracker::with_slow_ops_in_flight(utime_t* oldest_secs,
       // no more slow ops in flight
       return false;
     }
+    if (op.is_continuous()) {
+      return true; /* skip reporting */
+    }
     if (!op.warn_interval_multiplier)
       return true;
     slow++;
@@ -502,6 +505,7 @@ void TrackedOp::dump(utime_t now, Formatter *f, OpTracker::dumper lambda) const
   f->dump_stream("initiated_at") << get_initiated();
   f->dump_float("age", now - get_initiated());
   f->dump_float("duration", get_duration());
+  f->dump_bool("continuous", is_continuous());
   {
     f->open_object_section("type_data");
     lambda(*this, f);
index 238f1c7ac7c5fc68944324cfc3fe5fe8bf8246ce..1a921309ca01bd66b60fbaab728ebdaa05866afa 100644 (file)
@@ -207,6 +207,9 @@ public:
   template <typename T, typename U>
   typename T::Ref create_request(U params)
   {
+    constexpr bool has_is_continuous = requires(U u) {
+      { u->is_continuous() } -> std::same_as<bool>;
+    };
     typename T::Ref retval(new T(params, this));
     retval->tracking_start();
     if (is_tracking()) {
@@ -215,18 +218,25 @@ public:
       retval->mark_event("all_read", params->get_recv_complete_stamp());
       retval->mark_event("dispatched", params->get_dispatch_stamp());
     }
+    if constexpr (has_is_continuous) {
+      if (params->is_continuous()) {
+        retval->mark_continuous();
+      }
+    }
 
     return retval;
   }
 };
 
 class TrackedOp : public boost::intrusive::list_base_hook<> {
-private:
+public:
   friend class OpHistory;
   friend class OpTracker;
 
-  boost::intrusive::list_member_hook<> tracker_item;
+  static const uint64_t FLAG_CONTINUOUS = (1<<1);
 
+private:
+  boost::intrusive::list_member_hook<> tracker_item;
 public:
   typedef boost::intrusive::list<
   TrackedOp,
@@ -243,6 +253,7 @@ public:
     }
   };
 
+
 protected:
   OpTracker *tracker;          ///< the tracker we are associated with
   std::atomic_int nref = {0};  ///< ref count
@@ -281,6 +292,14 @@ protected:
     STATE_HISTORY
   };
   std::atomic<int> state = {STATE_UNTRACKED};
+  uint64_t flags = 0;
+
+  void mark_continuous() {
+    flags |= FLAG_CONTINUOUS;
+  }
+  bool is_continuous() const {
+    return flags & FLAG_CONTINUOUS;
+  }
 
   TrackedOp(OpTracker *_tracker, const utime_t& initiated) :
     tracker(_tracker),