]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/TrackedOp: do not count the ops marked as nowarn 58744/head
authorXiubo Li <xiubli@redhat.com>
Wed, 19 Jun 2024 03:27:33 +0000 (11:27 +0800)
committerXiubo Li <xiubli@redhat.com>
Tue, 23 Jul 2024 02:51:19 +0000 (10:51 +0800)
If an op is marked as nowarn then it won't be counted as the slow
requests, but currently it will count the initiated time when
iterating the inflight ops.

For example:

[WRN] : 1 slow requests, 1 included below; oldest blocked for > 38.764892 secs
[WRN] : slow request 33.875059 seconds old, received at 2024-06-17T14:14:34.228261+0000: client_request(client.78109915:11369251 mkdir #0x1008ecedea2/chk-89588 2024-06-17T14:14:34.097825+0000 caller_uid=1002960000, caller_gid=0{0,1002960000,}) currently failed to wrlock, waiting

The oldest blocked request is 38.764892 old, but the oldest slow
request reported is 33.875059 old.

Fixes: commit e4160d7e783 ("mds: don't report slow request for blocked filelock request")
Fixes: https://tracker.ceph.com/issues/66557
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 8debaf59b1d07e2dc48e96052800d67155e71ae4)

Conflicts:
- The commit c036b151465("common: support long running ops without
  slow warnings") is missing

src/common/TrackedOp.cc

index 32a1ab472a89f82096454b2ed672e173963a971c..96cfa2a1cbc0a6e535edc139f7baf0aae4f5e6d3 100644 (file)
@@ -342,12 +342,15 @@ bool OpTracker::visit_ops_in_flight(utime_t* oldest_secs,
   for (const auto sdata : sharded_in_flight_list) {
     ceph_assert(sdata);
     std::lock_guard locker(sdata->ops_in_flight_lock_sharded);
-    if (!sdata->ops_in_flight_sharded.empty()) {
-      utime_t oldest_op_tmp =
-       sdata->ops_in_flight_sharded.front().get_initiated();
+    for (auto& op : sdata->ops_in_flight_sharded) {
+      if (!op.warn_interval_multiplier)
+       continue;
+
+      utime_t oldest_op_tmp = op.get_initiated();
       if (oldest_op_tmp < oldest_op) {
         oldest_op = oldest_op_tmp;
       }
+      break;
     }
     std::transform(std::begin(sdata->ops_in_flight_sharded),
                    std::end(sdata->ops_in_flight_sharded),