]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OpRequest: Add detail description for delayed op in osd log file 53690/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:12:54 +0000 (19:12 -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 cd62c922d6d45b96e9c9f9889400a2ef9c5f5cfd..6ab8aceb5ff5b1885f430ec0e04005654c99cf1e 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 e0bc232a53b2d8428b4aeb6d19d4a8f13cfc80d7..33d1089dafefe472de500153aa24801a6929d83c 100644 (file)
@@ -63,6 +63,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;
@@ -111,7 +112,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";
@@ -152,8 +153,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");