diff options
author | Yan Jun <yan.jun8@zte.com.cn> | 2017-07-22 09:29:39 +0200 |
---|---|---|
committer | Yan Jun <yan.jun8@zte.com.cn> | 2017-07-22 09:29:39 +0200 |
commit | 79168ecb6f1af094b29600cac4e269ad77108ea2 (patch) | |
tree | 291cc0f39f7291df519f03a9bd2c80dc6d0b4d5b /src/osd | |
parent | common: dump field name of 'flag_point' and 'client_info' (diff) | |
download | ceph-79168ecb6f1af094b29600cac4e269ad77108ea2.tar.xz ceph-79168ecb6f1af094b29600cac4e269ad77108ea2.zip |
osd: store op request source info
if we use command 'ceph daemon osd.# dump_historic_ops' to check the history
tracked ops, the 'client_addr' is always dumped as '-' which result in clients
indistinguishable from each other.
"description": "osd_op(client.24123.0:328 3.36 3:6ec0d61b:::rbd_data.10472ae8944a.0000000000000289:head [write 4141056~4096 [fadvise_sequential]] snapc 0=[] ondisk+write+known_if_redirected e36)",
"initiated_at": "2017-07-22 14:24:25.925633",
"age": 4.893190,
"duration": 0.272642,
"type_data": {
"flag_point": "commit sent; apply or cleanup",
"client_info": {
"client": "client.24123",
"client_addr": "-",
"tid": 328
},
It is because 'connection' was reset to nullptr in function '_unregistered'
before op has been inserted into history, so the 'get_source_addr' always return
empty entity addr.
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
Diffstat (limited to '')
-rw-r--r-- | src/osd/OpRequest.cc | 5 | ||||
-rw-r--r-- | src/osd/OpRequest.h | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/osd/OpRequest.cc b/src/osd/OpRequest.cc index a71e35c90df..7d7f33e256a 100644 --- a/src/osd/OpRequest.cc +++ b/src/osd/OpRequest.cc @@ -39,6 +39,7 @@ OpRequest::OpRequest(Message *req, OpTracker *tracker) : } else if (req->get_type() == MSG_OSD_REPOP) { reqid = static_cast<MOSDRepOp*>(req)->reqid; } + req_src_inst = req->get_source_inst(); mark_event("header_read", request->get_recv_stamp()); mark_event("throttled", request->get_throttle_stamp()); mark_event("all_read", request->get_recv_complete_stamp()); @@ -52,8 +53,8 @@ void OpRequest::_dump(Formatter *f) const if (m->get_orig_source().is_client()) { f->open_object_section("client_info"); stringstream client_name, client_addr; - client_name << m->get_orig_source(); - client_addr << m->get_orig_source_addr(); + client_name << req_src_inst.name; + client_addr << req_src_inst.addr; f->dump_string("client", client_name.str()); f->dump_string("client_addr", client_addr.str()); f->dump_unsigned("tid", m->get_tid()); diff --git a/src/osd/OpRequest.h b/src/osd/OpRequest.h index 56663ecbd51..8008bf08a12 100644 --- a/src/osd/OpRequest.h +++ b/src/osd/OpRequest.h @@ -85,6 +85,7 @@ struct OpRequest : public TrackedOp { private: Message *request; /// the logical request we are tracking osd_reqid_t reqid; + entity_inst_t req_src_inst; uint8_t hit_flag_points; uint8_t latest_flag_point; utime_t dequeued_time; |