Skip to content
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

osd: revamp {noup,nodown,noin,noout} related commands #27735

Merged
merged 6 commits into from Jun 5, 2019

Conversation

xiexingguo
Copy link
Member

This works as a good supplement of #27563.

Signed-off-by: xie xingguo xie.xingguo@zte.com.cn

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

@xiexingguo
Copy link
Member Author

@liewegas I end up writing yet another patch which I think works as a good supplement of #27563 as we used to employ device-classes to separate different pools...

@xiexingguo
Copy link
Member Author

retest this please

@@ -2442,25 +2442,12 @@ bool OSDMonitor::prepare_mark_me_down(MonOpRequestRef op)

bool OSDMonitor::can_mark_down(int i)
{
if (osdmap.test_flag(CEPH_OSDMAP_NODOWN)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIXME: hrm, this is CEPH_OSDMAP_NODOWN, not CEPH_OSD_NODOWN

ceph osd add-noup $osd_0_device_class
ceph osd add-nodown $osd_0_device_class
ceph osd add-noin $osd_0_device_class
ceph osd add-noout $osd_0_device_class
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be a bit late, but I don't really like this syntax. I wonder if we should take the opportunity to switch to something more like:

ceph osd set-group <flag> <name>
ceph osd unset-group <flag> <name>

I don't love the 'group' part much either, tbh. But we usually do 'set' and 'unset' so it's weird to have 'add' and 'rm' here. And also weird to put the flag name as part of the command instead of as an argument.

@xiexingguo xiexingguo changed the title osd: add no{out,down,in,out} flags by device class osd: revamp {noup,nodown,noin,noout} related commands Apr 26, 2019
@xiexingguo
Copy link
Member Author

@liewegas Ready for re-review.

@xiexingguo
Copy link
Member Author

retest this please

@xiexingguo
Copy link
Member Author

@liewegas Can you look?

@xiexingguo
Copy link
Member Author

@liewegas Ping :-)

@xiexingguo
Copy link
Member Author

@liewegas Are there any other comments that I should address first? Also please let me know if you are reluctant to accept these changes...

@liewegas
Copy link
Member

@jdurgin @athanatos

@athanatos
Copy link
Contributor

The usage seems good to me. LGTM!

(What follows is pure bike-shedding, feel free to ignore it) Perhaps set-flags and unset-flags rather than set-group and unset-group might be clearer?

@liewegas
Copy link
Member

The usage seems good to me. LGTM!

(What follows is pure bike-shedding, feel free to ignore it) Perhaps set-flags and unset-flags rather than set-group and unset-group might be clearer?

By itself, ceph osd set-flags flagname osd-or-crush-node seems clearer. The -group came from trying to make it make sense in the context of ceph osd [un]set flagname, which sets cluster-wide flags. I can't say I like -group that much but set-flags seems like it would confuse the distinction between set vs set-flags.

@liewegas
Copy link
Member

retest this please

@athanatos
Copy link
Contributor

Makes sense.

@xiexingguo
Copy link
Member Author

retest this please

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This works as a good supplement of ceph#27563.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
…ecated

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
…nd to new implementation

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
It does not make much sense to add this kind of restrictions
as long as user is aware of what is going on.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
@xiexingguo
Copy link
Member Author

@liewegas make check passed now. Can we move forward with this now? I have some other bugs and improvements that depend on this.

@liewegas
Copy link
Member

liewegas commented Jun 3, 2019

@xiexingguo @neha-ojha @jdurgin We have a decision to make here.

If this targets octopus only, then we should change the encoding for OSDMap so that the new device flags are only encoded when the octopus feature is present. If we plan to backport this to nautilus, then that can stay the same.

But... if we backport, we should make the old command format still work (e.g., add-flagname and rm-flagname) in addition to the new names. In fact, we should probably make the old way continue to work for a release or two anyway?

@neha-ojha
Copy link
Member

@xiexingguo @neha-ojha @jdurgin We have a decision to make here.

If this targets octopus only, then we should change the encoding for OSDMap so that the new device flags are only encoded when the octopus feature is present. If we plan to backport this to nautilus, then that can stay the same.

But... if we backport, we should make the old command format still work (e.g., add-flagname and rm-flagname) in addition to the new names. In fact, we should probably make the old way continue to work for a release or two anyway?

Yes, I agree. In my opinion, we should probably backport it to nautilus and make sure the old commands still work. I'd be interested to know what others think, though.

@xiexingguo
Copy link
Member Author

xiexingguo commented Jun 3, 2019

If this targets octopus only, then we should change the encoding for OSDMap so that the new device flags are only encoded when the octopus feature is present. If we plan to backport this to nautilus, then that can stay the same.

I'd love to prepare the nautilus backports:-)

we should make the old command format still work (e.g., add-flagname and rm-flagname) in addition to the new names. In fact, we should probably make the old way continue to work for a release or two anyway?

They should (I just mark them as stale (deprecated) and there are still related tests, as you can see https://github.com/ceph/ceph/pull/27735/files#diff-9d634c21d02bca80a9ff0df5fd35acb9L1554 )

@xiexingguo
Copy link
Member Author

@xiexingguo xiexingguo merged commit 302d7bc into ceph:master Jun 5, 2019
@xiexingguo xiexingguo deleted the wip-device-class-noout branch June 5, 2019 06:17
@xiexingguo
Copy link
Member Author

Backports for nautilus: #28400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants