]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/test: fix unordered manifest-unset op 24687/head
authormyoungwon oh <omwmw@sk.com>
Sun, 21 Oct 2018 06:29:09 +0000 (15:29 +0900)
committermyoungwon oh <omwmw@sk.com>
Sun, 21 Oct 2018 09:05:40 +0000 (18:05 +0900)
- manifest unset op to foo-chunk object
 - remove manifest flag
 - commit
 - send an ack to a client
 - send decrement mesages ("chunk_put") to old chunks (bar-chunk)

Current unit test(ManifestUnset) send "chunk_read" command (to bar-chunk)
in order to see whether chunk's reference count is decreased.
But, as described above, "chunk_read" event can be triggered after a client
(test application) receives an ack. Therefore, there is a corner case
such as bar-chunk (in chunk pool) receives "chunk_read" first instead of "chunk_put"

Reference count model of dedup/tiering is based on false-positive (#24230).
So decreasing reference count is not guaranteed. If reference mismatch occur,
chunk-scrub (this is WIP) will fix it.
One guaranteed thing is that existing manifest flag is removed.

So, the solution of this commit is just re-send unset op, and then
chenk that return value is -EOPNOTSUPP (this means manifest flags is removed).

Fixes: http://tracker.ceph.com/issues/24485
Signed-off-by: Myoungwon Oh <omwmw@sk.com>
src/test/librados/tier.cc

index 4a777934af560b48e8c6cf332e5cb4f7ccc5288e..ba678c3fbc85139b7c2ba4264498c4e57759d1e8 100644 (file)
@@ -3378,13 +3378,29 @@ TEST_F(LibRadosTwoPoolsPP, ManifestUnset) {
   {
     bufferlist in, out;
     cache_ioctx.exec("bar", "cas", "chunk_read", in, out);
-    ASSERT_EQ(0U, out.length());
+    if (out.length() != 0U) {
+      ObjectWriteOperation op;
+      op.unset_manifest();
+      librados::AioCompletion *completion = cluster.aio_create_completion();
+      ASSERT_EQ(0, ioctx.aio_operate("foo", completion, &op));
+      completion->wait_for_safe();
+      ASSERT_EQ(-EOPNOTSUPP, completion->get_return_value());
+      completion->release();
+    }
   }
   // chunk's refcount 
   {
     bufferlist in, out;
     cache_ioctx.exec("bar-chunk", "cas", "chunk_read", in, out);
-    ASSERT_EQ(0u, out.length());
+    if (out.length() != 0U) {
+      ObjectWriteOperation op;
+      op.unset_manifest();
+      librados::AioCompletion *completion = cluster.aio_create_completion();
+      ASSERT_EQ(0, ioctx.aio_operate("foo-chunk", completion, &op));
+      completion->wait_for_safe();
+      ASSERT_EQ(-EOPNOTSUPP, completion->get_return_value());
+      completion->release();
+    }
   }
 
   // wait for maps to settle before next test