Project

General

Profile

Backport #20325

Updated by Nathan Cutler almost 3 years ago

libradosstriper fails to delete striped objects of zero length without returning any kind of error.
Steps to reproduce:
# Create an empty striper object:
<pre>
~# echo 123 | rados --striper -p sata put test -
~# rados --striper -p sata truncate test 0
~# rados --striper -p sata stat test
sata/test mtime 2017-06-16 02:31:42.000000, size 0
</pre>
Note: You cannot write empty object straight into libradosstriper, because it's causes an assertion failure. This issue is fixed in commit 7cce1e8c51640f466d8bb37a21c0d5f1b00db8ab which is not currently a part of jewel release.
# Try to remove striped object:
<pre>
~# rados --striper -p sata rm test
~# echo $?
0
</pre>
# Check that object is still present:
<pre>
~# rados -p sata ls
test.0000000000000000
~# rados --striper -p sata ls
test
</pre>

Expected result:
Striped object is deleted

It seems that stripe math in "libradosstriper::RadosStriperImpl::remove()" is missing corner case of an empty object, so I'm attaching a simple patch to fix this.

Also this issue is probably fixed in commit 7a50ea479e7e5c2909d899d89d33d3fb082257f8, which is not part of the jewel release and pretty massive to backport.

Back