]> 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>
Thu, 10 Oct 2019 00:11:36 +0000 (20:11 -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)

Conflicts:
src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc: trivial resolution

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

index e96bec640a134df2cab874c96cc1394e740463ff..2563271834805b41bcf904d0b44dc534aa51f290 100644 (file)
@@ -98,6 +98,7 @@ struct ResetRequest<MockTestImageCtx> {
                               const std::string &mirror_uuid,
                               ContextWQ *op_work_queue, Context *on_finish) {
     assert(s_instance != nullptr);
+    EXPECT_EQ(librbd::Journal<>::LOCAL_MIRROR_UUID, mirror_uuid);
     s_instance->on_finish = on_finish;
     return s_instance;
   }
index bf52853277a91c26aa3b3d4afab899e41f1060ae..e7e1e8b284a7391a6cb3fcc96c28e5afd356d8f6 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();
 }