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
rados: implement rm --force option to force remove when full #6202
Conversation
@athanatos @liewegas please help check! |
@@ -2101,7 +2106,11 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts, | |||
if (use_striper) { | |||
ret = striper.remove(oid); | |||
} else { | |||
ret = io_ctx.remove(oid); | |||
if ( force == "true" ){ |
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.
pls fix whitespace
2 small issues, otherwise looks good! |
836dd69
to
b6ac5da
Compare
@liewegas fixed, please recheck ! |
lgtm. Do you mind adding a test to qa/workunits/rados/... that creates a pool, sets a small quota, fills it up, and shows that remove fails, but remove --force-full succeeds? |
Ideally, this should also be done in radosstriper, by patching in the same way libradosstriper/RadosStriperImpl so that it calls the new IoCtl entry point. |
0992b23
to
5246a9b
Compare
I've put comments in the code directly. I have basically only one : why duplicate all calls and not add an extra flags argument with default value 0 ? |
@sponce We can't change the function signatures without breaking the .so's ABI. |
ok, that was my fear. Thanks for the confirmation. |
@cxwshawn ping |
037d21b
to
b04d75b
Compare
b04d75b
to
0a9f643
Compare
@cxwshawn the test/cephtool-test-rados.sh test failed. You can run it locally from the src directory to reproduce the problem. |
0a9f643
to
f9e15be
Compare
ceph osd pool set-quota $p max_objects 1 | ||
V1=`mktemp fooattrXXXXXXX` | ||
rados put $OBJ $V1 -p $p | ||
sleep 30 |
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.
Do you mind replacing this with a loop that looks for the full flag on teh pool in the 'ceph osd dump' output? Otherwise this will slow down the make check execution.
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.
Otherwise, looks good. Almost there!
f9e15be
to
cc9ca2c
Compare
@liewegas fixed, please review again. |
@@ -1239,7 +1239,7 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts, | |||
|
|||
std::string run_name; | |||
std::string prefix; | |||
|
|||
std::string forcefull(""); |
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.
why not make it a bool
?
librados extend remove interface, add flags parameter, and use this extended interface to implement force remove when cluster full. Signed-off-by: Xiaowei Chen <chen.xiaowei@h3c.com>
extend libradosstripper remove interface and rados tool rm force-full when use_stripper. Signed-off-by: Xiaowei Chen <chen.xiaowei@h3c.com>
4751199
to
54a6ba8
Compare
lgtm after the qa run passed. |
rados: implement rm --force option to force remove when full Reviewed-by: Kefu Chai <kchai@redhat.com>
[librados] extend remove interface, add flags parameter
rados tool use the extended librados interface to implement force remove.
test:
when cluster full, ceph -s show: 3 full osd(s)(only 3 osds in my cluster),
use:
./rados -p poolname rm objname --force (delete ok)
but ./rados -p poolname rm objname will stuck.
Signed-off-by: Xiaowei Chen chen.xiaowei@h3c.com