From: yite.gu Date: Tue, 14 Mar 2023 13:58:56 +0000 (-0400) Subject: osd/OpRequest: Add detail description for delayed op in osd log file X-Git-Tag: v17.2.7~78^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F53690%2Fhead;p=ceph.git osd/OpRequest: Add detail description for delayed op in osd log file 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 (cherry picked from commit a6c0e601b13dc2209cb6d546d249988d0472e1d4) --- diff --git a/src/osd/OpRequest.cc b/src/osd/OpRequest.cc index cd62c922d6d4..6ab8aceb5ff5 100644 --- a/src/osd/OpRequest.cc +++ b/src/osd/OpRequest.cc @@ -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, diff --git a/src/osd/OpRequest.h b/src/osd/OpRequest.h index e0bc232a53b2..33d1089dafef 100644 --- a/src/osd/OpRequest.h +++ b/src/osd/OpRequest.h @@ -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");