]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_test_rados_api_tier: fix cleanup of whiteouts 2926/head
authorSage Weil <sage@redhat.com>
Fri, 14 Nov 2014 06:33:10 +0000 (22:33 -0800)
committerSage Weil <sage@redhat.com>
Fri, 14 Nov 2014 06:33:25 +0000 (22:33 -0800)
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>
src/test/librados/TestCase.cc

index 42cf3a7b846cdc292239c591c551df5356204359..d52d4d9b0bd424ad7f8f8eb607dc7e28602e5e56 100644 (file)
@@ -327,7 +327,14 @@ void RadosTestPP::cleanup_namespace(librados::IoCtx ioctx, std::string ns)
   for (NObjectIterator it = ioctx.nobjects_begin();
        it != ioctx.nobjects_end(); ++it) {
     ioctx.locator_set_key(it->get_locator());
-    ASSERT_EQ(0, ioctx.remove(it->get_oid()));
+    ObjectWriteOperation op;
+    op.remove();
+    librados::AioCompletion *completion = s_cluster.aio_create_completion();
+    ASSERT_EQ(0, ioctx.aio_operate(it->get_oid(), completion, &op,
+                                  librados::OPERATION_IGNORE_CACHE));
+    completion->wait_for_safe();
+    ASSERT_EQ(0, completion->get_return_value());
+    completion->release();
   }
 }