]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OpRequest: Add detail description for delayed op in osd log file 53693/head
authoryite.gu <yitegu0@gmail.com>
Tue, 14 Mar 2023 13:58:56 +0000 (09:58 -0400)
committerPrashant D <pdhange@redhat.com>
Tue, 26 Sep 2023 23:21:22 +0000 (19:21 -0400)
Have no description delayed reason while the op mark is delayed
in the log file. Add a detailed description while the op mark
is delayed, it helps to quickly determine the problem and leave
a trace.

Signed-off-by: Yite Gu <yitegu0@gmail.com>
(cherry picked from commit a6c0e601b13dc2209cb6d546d249988d0472e1d4)

src/osd/OpRequest.cc
src/osd/OpRequest.h

index 0eb92c23a6a3e2642d1c033203cd8d6218e46821..e77ee2ca52ac7c0836142c9a297ac6245fa0d09c 100644 (file)
@@ -121,6 +121,7 @@ void OpRequest::mark_flag_point(uint8_t flag, const char *s) {
   uint8_t old_flags = hit_flag_points;
 #endif
   mark_event(s);
+  last_event_detail = s;
   hit_flag_points |= flag;
   latest_flag_point = flag;
   tracepoint(oprequest, mark_flag_point, reqid.name._type,
index daa0e1993a3bd43199b36eb6cf32a6595af70d44..1659658e2cb2d68203aa5884fb1627ca7d0e57ea 100644 (file)
@@ -66,6 +66,7 @@ private:
   entity_inst_t req_src_inst;
   uint8_t hit_flag_points;
   uint8_t latest_flag_point;
+  const char* last_event_detail = nullptr;
   utime_t dequeued_time;
   static const uint8_t flag_queued_for_pg=1 << 0;
   static const uint8_t flag_reached_pg =  1 << 1;
@@ -123,7 +124,7 @@ public:
     switch(latest_flag_point) {
     case flag_queued_for_pg: return "queued for pg";
     case flag_reached_pg: return "reached pg";
-    case flag_delayed: return "delayed";
+    case flag_delayed: return last_event_detail;
     case flag_started: return "started";
     case flag_sub_op_sent: return "waiting for sub ops";
     case flag_commit_sent: return "commit sent; apply or cleanup";
@@ -164,8 +165,8 @@ public:
   void mark_reached_pg() {
     mark_flag_point(flag_reached_pg, "reached_pg");
   }
-  void mark_delayed(const std::string& s) {
-    mark_flag_point_string(flag_delayed, s);
+  void mark_delayed(const char* s) {
+    mark_flag_point(flag_delayed, s);
   }
   void mark_started() {
     mark_flag_point(flag_started, "started");