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/OSDMonitor.cc : set erasure-code-profile to "" when create replicated pools. #19673
Conversation
@zouaiguo please replace |
c48e2a0
to
909e140
Compare
OK, I have changed |
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.
While you are at it, please also ensure you validate the case when the pool is not erasure and yet the user is trying to set an erasude-code profile on it, and make sure to throw an error at the user. This should be done somewhere in (or after) https://github.com/ceph/ceph/pull/19673/files#diff-0a5db46a44ae9900e226289a810f10e8R10149 but before you change any state.
Also, please add a test to validate not only the erroneous case (before this patch) and ensure it no longer happens, as well as a case for the success of this patch. I recommend doing that on qa/workunits/cephtool/test.sh.
Also, please set commit title to |
there has a little bug or misunderstand in create a replicate pool python code:
so erasure_code_profile is required when use a specify rule to create a replicated pool |
fa4bcac
to
0aaa667
Compare
|
@jecluis can you review it for me? |
qa/workunits/cephtool/test.sh
Outdated
ceph osd pool create replicated 12 12 replicated foo | ||
ceph osd erasure-code-profile rm foo | ||
ceph osd pool delete replicated replicated --yes-i-really-really-mean-it | ||
ceph osd crush rule rm foo |
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 think the test below covers this test already.
src/mon/OSDMonitor.cc
Outdated
@@ -10194,6 +10194,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, | |||
} else { | |||
//NOTE:for replicated pool,cmd_map will put rule_name to erasure_code_profile field | |||
rule_name = erasure_code_profile; | |||
erasure_code_profile = ""; |
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 you update OSDMonitor::prepare_new_pool()
also ? so we don't update pi->erasure_code_profile
with the given erasure_code_profile
if pool_type == pg_pool_t::TYPE_REPLICATED
?
0aaa667
to
a61e62c
Compare
@tchaikov i have modified as your mention |
…ated pools. when we create a pool specify a rule, for example "ceph osd pool create foo replicated 10 rule_foo", we will set pool foo erasure-code-profile to rule_foo, if there has an erasure-code-profile names rule_foo, use "ceph osd erasure-code-profile rule_foo" will fail, "Error EBUSY: foo pool(s) are using the erasure code profile 'rule_foo'", this is wrong. we should do: 1. set erasure-code-profile to "" when create replicated pools 2. whether erasure-code-profile is used by pool not only judge pool erasure_code_profile property and also the pool is_erasure Signed-off-by: zouaiguo <zou.aiguo@zte.com.cn>
hey @jecluis does the latest change address your comment? |
@jecluis could you re-review this PR? |
when we create a pool specify a rule, for example "ceph osd pool create foo replicated 10 rule_foo",
we will set pool foo erasure-code-profile to rule_foo,
if there has an erasure-code-profile names rule_foo, use "ceph osd erasure-code-profile rule_foo" will fail,
"Error EBUSY: foo pool(s) are using the erasure code profile 'rule_foo'", this is wrong.
we should do:
Signed-off-by: zouaiguo zou.aiguo@zte.com.cn