]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: set image as primary when moving to trash
authorJason Dillaman <dillaman@redhat.com>
Wed, 11 Sep 2019 18:50:24 +0000 (14:50 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 9 Oct 2019 21:24:09 +0000 (17:24 -0400)
This will allow the the image to be restored and re-mirrored if
desired.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 73d4577d1b9a9bff087b555c9de5005d1120a0ea)

src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc
src/tools/rbd_mirror/image_deleter/TrashMoveRequest.cc

index b3f204c574983ad1b416a025b59868a60de65584..b2ec9692060fc868a732a1f5b482790b0b4f4c16 100644 (file)
@@ -98,6 +98,7 @@ struct ResetRequest<MockTestImageCtx> {
                               const std::string &mirror_uuid,
                               ContextWQ *op_work_queue, Context *on_finish) {
     ceph_assert(s_instance != nullptr);
+    EXPECT_EQ(librbd::Journal<>::LOCAL_MIRROR_UUID, mirror_uuid);
     s_instance->on_finish = on_finish;
     return s_instance;
   }
index 90a45090874f22e019d05acb64d9c6f484113479..92db22cac548931193903b40314f3d948c50ff4c 100644 (file)
@@ -159,7 +159,7 @@ void TrashMoveRequest<I>::reset_journal() {
     TrashMoveRequest<I>, &TrashMoveRequest<I>::handle_reset_journal>(this);
   auto req = librbd::journal::ResetRequest<I>::create(
     m_io_ctx, m_image_id, librbd::Journal<>::IMAGE_CLIENT_ID,
-    m_mirror_uuid, m_op_work_queue, ctx);
+    librbd::Journal<>::LOCAL_MIRROR_UUID, m_op_work_queue, ctx);
   req->send();
 }