Doing a normal DELETE on a whiteout returns ENOENT. Use the IGNORE_CACHE
flag to make sure it removes the whiteout, too.
Fixes: #10052
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit
8dde6a61921798aa188bd69406c8fa7afeb96b45)
Conflicts:
src/test/librados/TestCase.cc
for it of type ObjectIterator:
- use it->first instead of it->get_oid()
- use it->second instead of it->get_locator()
for (ObjectIterator it = ioctx.objects_begin();
it != ioctx.objects_end(); ++it) {
ioctx.locator_set_key(it->second);
- ASSERT_EQ(0, ioctx.remove(it->first));
+ ObjectWriteOperation op;
+ op.remove();
+ librados::AioCompletion *completion = s_cluster.aio_create_completion();
+ ASSERT_EQ(0, ioctx.aio_operate(it->first, completion, &op,
+ librados::OPERATION_IGNORE_CACHE));
+ completion->wait_for_safe();
+ ASSERT_EQ(0, completion->get_return_value());
+ completion->release();
}
}