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

crushtool: set type 0 name "device" for --build option #6824

Merged
merged 2 commits into from Dec 31, 2015

Conversation

SandyXSD
Copy link

@SandyXSD SandyXSD commented Dec 7, 2015

The crushmap built by crushtool cannot be used directly as the name of type 0 is not specified.
We may decompile the crushmap(it will automatically add type 0) and then recompile it to make it usable, but that's extra effort.

Signed-off-by: Sangdi Xu xu.sangdi@h3c.com

@SandyXSD
Copy link
Author

SandyXSD commented Dec 7, 2015

Simple test steps:
crushtool -o crushmap --build --num_osds 9 host straw 3 root straw 0
crushtool -i crushmap --check 9

@smithfarm smithfarm added the tools label Dec 7, 2015
@SandyXSD
Copy link
Author

@liewegas Could you take a look at this minor crushtool fix, thank you!

@@ -617,6 +617,7 @@ int main(int argc, const char **argv)
crush.set_item_name(i, "osd." + stringify(i));
}

crush.set_type_name(0, "device");
Copy link
Member

Choose a reason for hiding this comment

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

How about "osd"? That's what the default OSDMap simple generator uses, and this function is also assuming "osd" naming above.

@SandyXSD
Copy link
Author

@liewegas Sure, that's definitely a better name :D. I have also changed the default type 0 name in the decompile process, but I'm not sure if there needs any other cleanup work.

Sangdi Xu added 2 commits December 17, 2015 17:28
The crushmap built by crushtool cannot be used directly as the name of type 0 is not specified.
We may decompile the crushmap(it will automatically add type 0) and then recompile it to make it usable, but that's extra effort.

Signed-off-by: Sangdi Xu <xu.sangdi@h3c.com>
Change the type 0 name from "device" to "osd", just to make it consistent

Signed-off-by: Sangdi Xu <xu.sangdi@h3c.com>
@liewegas
Copy link
Member

Actually the second patch I'm not sure about. Right now the "osd" naming is only used in the build method, so this keeps us consistent there, but leaves everything else with a generic "device". For example the second patch breaks the cli unit tests that expect the old naming. Let's just do the first patch?

@SandyXSD
Copy link
Author

@liewegas Hmm, sorry I made it a bit confusing, but in fact it's the first patch that fails the unit test. Currently the behavior is that type 0 name is not specified when built, and then set as "device" in the decompile stage. However, if it's already named as "osd", decompile won't change it. So now we probably have two options:

  1. use the name "device" for build method, just as my first attempt
  2. use the name "osd" and modify the two affected unit test as well, i.e. the first patch in this PR
    what do you think?

@SandyXSD
Copy link
Author

@liewegas I will discard the second patch, but let's decide on the solution to --build opition first so that the bot may have an easier life. Any suggestion about the fix? Thank you!

@liewegas
Copy link
Member

Sorry for the slow reply. On second thought I think what you have here looks okay. Thanks!

liewegas added a commit that referenced this pull request Dec 31, 2015
crushtool: set type 0 name "device" for --build option

Reviewed-by: Sage Weil <sage@redhat.com>
@liewegas liewegas merged commit a67f873 into ceph:master Dec 31, 2015
@SandyXSD SandyXSD deleted the wip-crushtool-build branch January 4, 2016 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants