From: Jason Dillaman Date: Wed, 11 Sep 2019 18:50:24 +0000 (-0400) Subject: rbd-mirror: set image as primary when moving to trash X-Git-Tag: v13.2.7~65^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=48a29c734915cf9c3ea29d69785340be406e268b;p=ceph.git rbd-mirror: set image as primary when moving to trash This will allow the the image to be restored and re-mirrored if desired. Signed-off-by: Jason Dillaman (cherry picked from commit 73d4577d1b9a9bff087b555c9de5005d1120a0ea) Conflicts: src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc: trivial resolution --- diff --git a/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc b/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc index e96bec640a1..25632718348 100644 --- a/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc +++ b/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc @@ -98,6 +98,7 @@ struct ResetRequest { 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; } diff --git a/src/tools/rbd_mirror/image_deleter/TrashMoveRequest.cc b/src/tools/rbd_mirror/image_deleter/TrashMoveRequest.cc index bf52853277a..e7e1e8b284a 100644 --- a/src/tools/rbd_mirror/image_deleter/TrashMoveRequest.cc +++ b/src/tools/rbd_mirror/image_deleter/TrashMoveRequest.cc @@ -159,7 +159,7 @@ void TrashMoveRequest::reset_journal() { TrashMoveRequest, &TrashMoveRequest::handle_reset_journal>(this); auto req = librbd::journal::ResetRequest::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(); }