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
mon: change osdmap flags set and unset messages #9252
Conversation
|
@vumrao could you add a simple test in |
pending_inc.new_flags |= flag; | ||
ss << "set " << OSDMap::get_flag_string(flag); | ||
if (osdmap.test_flag(flag)) { | ||
ss << OSDMap::get_flag_string(flag) << " flag is already set"; |
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.
could return false
here right away.
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.
ack.
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.
- After applying your suggestion , I tested
$ceph osd set
and$ceph osd unset
commands just hangs if I try to returnfalse
without callingwait_for_finished_proposal()
inif condition
and if I try to returnfalse
with callingwait_for_finished_proposal()
then also same behavior. - To me it looks like as
$ceph osd set
and$ceph osd unset
both expect to returntrue
withwait_for_finished_proposal()
as I was doing. - As if we are setting a already set flag means condition is true as this is the behavior of
$ceph osd set
we should returntrue
as flag is already set. - Same goes for unset as in unset also if we unset a flag which is not set then also we should return true as
$ceph osd unset
behavior is to flag should be unset and which is the case here. - Please let me know if my understanding is wrong.
@tchaikov sure will do it. |
e2952af
to
16db7e0
Compare
@tchaikov I have added a simple test in
|
Thank you @tchaikov for your help and nice discussion in |
c606f49
to
fb1d3a5
Compare
|
|
@vumrao are you using selinux could you check the files in your testdir to see if it has some xattr already? |
@tchaikov yes you are right Kefu, I have selinux enabled in my local box and also xattr file :
|
This isn't right. The mon commands must be idempotent. There is a debug option somewhere in fact that sends every command twice and asserts that if the first succeeds, teh second succeeds too. |
Thanks Sage for your inputs. I had discussion with Kefu will modify the patch. |
|
test this please. |
@vumrao thanks filed http://tracker.ceph.com/issues/16014 |
test this please. |
1 similar comment
test this please. |
ceph osd set noout >& $TMPFILE || return 1 | ||
check_response "set noout" | ||
ceph osd set noout >& $TMPFILE || return 1 | ||
expect_failure $TMPDIR "noout flag is already set" |
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.
@vumrao this should not fail. as per sage
The mon commands must be idempotent
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.
@kchai ahh sorry , right it should be check_response()
instead of expect_failure()
.
Right, as sage pointed earlier:
The mon commands must be idempotent
I think it will apply to all the new tests for new messages ? will change it or do you think any other change is needed.
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.
yeah. just the new messages.
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 Kefu, sure will make the changes and test it locally and then will send the updated commit.
lgtm. |
|
missed it in last qa batch. will include it in next run. |
@tchaikov thank you ! |
This PR is still wrong. At any time the MonClient may resend a command (e.g., due ot a transient network disconnect, or a mon quorum change). Making messages like "set foo" and "foo already set" will be incorrect in some cases. This is why we try to use messages like "flag foo is (or was already) set". |
Thank you Sage for your inputs. I will change the messages and will modify the test cases. |
Fixes: http://tracker.ceph.com/issues/15983 Signed-off-by: Vikhyat Umrao <vumrao@redhat.com>
lgtm. @liewegas what do you think? |
looks good, thanks! |
tested in http://pulpito.ceph.com/kchai-2016-07-10_07:48:29-rados-wip-kefu-testing---basic-mira/ the non-environmental failures are addressed by #10234 . |
mon : change osdmap flags set and unset message
Fixes: http://tracker.ceph.com/issues/15983
Signed-off-by: Vikhyat Umrao vumrao@redhat.com