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
messages/MOSDOp: a fixes of encode_payload #16836
Conversation
@joscollin make check failed?why?please give me some help.Thinks. |
Jenkins retest this please |
@heyingstar I have given a retest. |
@yuyuyu101 please help me for review this.Thanks. |
@liewegas can you help me for review this?Thanks. ` |
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.
I'm concerned about this. MOSDOp has other functions which write directly into the data bufferlist, although I'm not sure they're actually used — can you remove them if they're not? If they are in use, we'll need to do something to prevent them causing issues.
You did catch the only user of get_data() which seems to break this though, so good job there! :)
@gregsfortytwo Yes,I know it.we should make sure the If i could modify more codes,I can do this: |
Sounds like you've identified the basic possibilities. I think I'd prefer making get_data() return a const bufferlist& and making data a private member? Not sure though. |
@gregsfortytwo If i fix this mistake with |
My concern is that this is a very high-risk change. If anybody adds direct data bufferlist manipulation, or we missed some obtuse way it happens, then it breaks horribly and it won't be clear why. |
Couldn't we also just mark a flag for if the op vector has already been merged into the data bl, and not do it repeatedly? That seems like a much simpler, smaller fix! |
@gregsfortytwo Yes,I see. And I will pull a new feature with |
src/messages/MOSDOp.h
Outdated
@@ -244,7 +244,7 @@ class MOSDOp : public MOSDFastDispatchOp { | |||
|
|||
// marshalling | |||
void encode_payload(uint64_t features) override { | |||
|
|||
data.clear(); |
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.
@heyingstar tab space left
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.
Thanks.
I update code now.
src/messages/MOSDOpReply.h
Outdated
@@ -154,7 +154,7 @@ class MOSDOpReply : public Message { | |||
|
|||
public: | |||
void encode_payload(uint64_t features) override { | |||
|
|||
data.clear(); |
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.
@heyingstar Tab space left
@gregsfortytwo I update the code now with your mind. |
Can you squash this down to a single commit? We don't want both of them and the master merge in patch history. :) |
Ok. |
d077b8e
to
d96f2a8
Compare
d96f2a8
to
4e6487c
Compare
5447f8d
to
c834140
Compare
If we set config ms_dump_on_send,the function encode may run twice. Then data will double of normal data. Signed-off-by: Ying He <heyingbj@inspur.com>
05b080d
to
a36ee8c
Compare
@gregsfortytwo I squash this PR to a single commit. |
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.
Reviewed-by: Greg Farnum gfarnum@redhat.com
This still needs to get run through an integration branch test suite before merge; it may be a few days but will happen eventually.
jenkins test docs |
1 similar comment
jenkins test docs |
If we set config
ms_dump_on_send
,the functionencode
may run twice.Thendata
will double of normal data.the function
SimpleMessenger::submit_message
orAsyncMessenger::submit_message
may runm->encode(-1, MSG_CRC_ALL)
.This code can runMOSDOp::encode_payload
.when the function of
encode
run twice.the codeOSDOp::merge_osd_op_vector_in_data
will run twice.so we should add
data.clear()
at begin ofencode_payload
.Signed-off-by: Ying He heyingbj@inspur.com