New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MOSDRepOp/ MOSDRepOpReply: Simple Messenger optimization #6503
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,18 +46,26 @@ class MOSDRepOpReply : public Message { | |
// piggybacked osd state | ||
eversion_t last_complete_ondisk; | ||
|
||
bufferlist::iterator p; | ||
// Decoding flags. Decoding is only needed for messages catched by pipe reader. | ||
bool final_decode_needed; | ||
|
||
virtual void decode_payload() { | ||
bufferlist::iterator p = payload.begin(); | ||
p = payload.begin(); | ||
::decode(map_epoch, p); | ||
::decode(reqid, p); | ||
::decode(pgid, p); | ||
} | ||
|
||
void finish_decode() { | ||
if (!final_decode_needed) | ||
return; // Message is already final decoded | ||
::decode(ack_type, p); | ||
::decode(result, p); | ||
::decode(last_complete_ondisk, p); | ||
|
||
::decode(from, p); | ||
final_decode_needed = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here.. the decode format doesn't change. Also, the fields are all fixed length, and there are only a few pas the first 3 required ones.. I'm guessing this isn't going to make any measurable difference? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think since we have split the MOSDRepOp msg into two stages, split the MOSDRepOpReply require minimal effort. |
||
} | ||
virtual void encode_payload(uint64_t features) { | ||
::encode(map_epoch, payload); | ||
|
@@ -91,12 +99,14 @@ class MOSDRepOpReply : public Message { | |
from(from), | ||
pgid(req->pgid.pgid, req->from.shard), | ||
ack_type(at), | ||
result(result_) { | ||
result(result_), | ||
final_decode_needed(false) { | ||
set_tid(req->get_tid()); | ||
} | ||
MOSDRepOpReply() | ||
: Message(MSG_OSD_REPOPREPLY), map_epoch(0), | ||
ack_type(0), result(0) {} | ||
ack_type(0), result(0), | ||
final_decode_needed(true) {} | ||
private: | ||
~MOSDRepOpReply() {} | ||
|
||
|
@@ -105,14 +115,16 @@ class MOSDRepOpReply : public Message { | |
|
||
void print(ostream& out) const { | ||
out << "osd_repop_reply(" << reqid | ||
<< " " << pgid; | ||
if (ack_type & CEPH_OSD_FLAG_ONDISK) | ||
out << " ondisk"; | ||
if (ack_type & CEPH_OSD_FLAG_ONNVRAM) | ||
out << " onnvram"; | ||
if (ack_type & CEPH_OSD_FLAG_ACK) | ||
out << " ack"; | ||
out << ", result = " << result; | ||
<< " " << pgid; | ||
if (!final_decode_needed) { | ||
if (ack_type & CEPH_OSD_FLAG_ONDISK) | ||
out << " ondisk"; | ||
if (ack_type & CEPH_OSD_FLAG_ONNVRAM) | ||
out << " onnvram"; | ||
if (ack_type & CEPH_OSD_FLAG_ACK) | ||
out << " ack"; | ||
out << ", result = " << result; | ||
} | ||
out << ")"; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reqid and pgid are always present (assert !partial_decode_needed). the rest (poid, version, hit_set_history are condition on final_decode_needed)