]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: pass mirror image mode to create/clone image state machines
authorJason Dillaman <dillaman@redhat.com>
Tue, 28 Jan 2020 17:10:03 +0000 (12:10 -0500)
committerJason Dillaman <dillaman@redhat.com>
Thu, 30 Jan 2020 15:26:36 +0000 (10:26 -0500)
The rbd-mirror daemon will need to be able to create images using
snapshot-based mirroring.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/api/Image.cc
src/librbd/api/Migration.cc
src/librbd/image/CloneRequest.cc
src/librbd/image/CloneRequest.h
src/librbd/image/CreateRequest.cc
src/librbd/image/CreateRequest.h
src/librbd/internal.cc
src/test/librbd/image/test_mock_CloneRequest.cc
src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc
src/tools/rbd_mirror/image_replayer/CreateImageRequest.cc

index 6ebe78ff7e8447fed0279bece188c783b532d51c..2df690e25ada1e5a4a2baf974f96b7c75c5cc709 100644 (file)
@@ -615,7 +615,8 @@ int Image<I>::deep_copy(I *src, librados::IoCtx& dest_md_ctx,
     std::string dest_id = util::generate_image_id(dest_md_ctx);
     auto *req = image::CloneRequest<I>::create(
       config, parent_io_ctx, parent_spec.image_id, "", parent_spec.snap_id,
-      dest_md_ctx, destname, dest_id, opts, "", "", src->op_work_queue, &ctx);
+      dest_md_ctx, destname, dest_id, opts, cls::rbd::MIRROR_IMAGE_MODE_JOURNAL,
+      "", "", src->op_work_queue, &ctx);
     req->send();
     r = ctx.wait();
   }
index 1319eb237534c7a81ac5b79a07c183ab258d02fb..cbdfd5b4666ce9195f2c54294102e2eff7557d79 100644 (file)
@@ -1232,8 +1232,8 @@ int Migration<I>::create_dst_image() {
   if (parent_spec.pool_id == -1) {
     auto *req = image::CreateRequest<I>::create(
       config, m_dst_io_ctx, m_dst_image_name, m_dst_image_id, size,
-      m_image_options, "", "", true /* skip_mirror_enable */, op_work_queue,
-      &on_create);
+      m_image_options, true /* skip_mirror_enable */,
+      cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "", op_work_queue, &on_create);
     req->send();
   } else {
     r = util::create_ioctx(m_src_image_ctx->md_ctx, "destination image",
@@ -1245,8 +1245,8 @@ int Migration<I>::create_dst_image() {
 
     auto *req = image::CloneRequest<I>::create(
       config, parent_io_ctx, parent_spec.image_id, "", parent_spec.snap_id,
-      m_dst_io_ctx, m_dst_image_name, m_dst_image_id, m_image_options, "", "",
-      op_work_queue, &on_create);
+      m_dst_io_ctx, m_dst_image_name, m_dst_image_id, m_image_options,
+      cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "", op_work_queue, &on_create);
     req->send();
   }
 
index 45ea1749526a24781e004ac088794b4976d9a20f..02793da61f106941865771d00bb459688989d450 100644 (file)
@@ -39,13 +39,14 @@ CloneRequest<I>::CloneRequest(ConfigProxy& config,
                              const std::string &c_name,
                              const std::string &c_id,
                              ImageOptions c_options,
+                              cls::rbd::MirrorImageMode mirror_image_mode,
                              const std::string &non_primary_global_image_id,
                              const std::string &primary_mirror_uuid,
                              ContextWQ *op_work_queue, Context *on_finish)
   : m_config(config), m_parent_io_ctx(parent_io_ctx),
     m_parent_image_id(parent_image_id), m_parent_snap_name(parent_snap_name),
     m_parent_snap_id(parent_snap_id), m_ioctx(c_ioctx), m_name(c_name),
-    m_id(c_id), m_opts(c_options),
+    m_id(c_id), m_opts(c_options), m_mirror_image_mode(mirror_image_mode),
     m_non_primary_global_image_id(non_primary_global_image_id),
     m_primary_mirror_uuid(primary_mirror_uuid),
     m_op_work_queue(op_work_queue), m_on_finish(on_finish),
@@ -278,11 +279,10 @@ void CloneRequest<I>::create_child() {
   Context *ctx = create_context_callback<
     klass, &klass::handle_create_child>(this);
 
-  std::shared_lock image_locker{m_parent_image_ctx->image_lock};
   CreateRequest<I> *req = CreateRequest<I>::create(
-    m_config, m_ioctx, m_name, m_id, m_size, m_opts,
-    m_non_primary_global_image_id, m_primary_mirror_uuid, true,
-    m_op_work_queue, ctx);
+    m_config, m_ioctx, m_name, m_id, m_size, m_opts, true,
+    cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, m_non_primary_global_image_id,
+    m_primary_mirror_uuid, m_op_work_queue, ctx);
   req->send();
 }
 
@@ -525,12 +525,9 @@ void CloneRequest<I>::enable_mirror() {
   using klass = CloneRequest<I>;
   Context *ctx = create_context_callback<
     klass, &klass::handle_enable_mirror>(this);
-
-  // TODO: in future rbd-mirror will want to enable mirroring
-  // not only in journal mode.
-  mirror::EnableRequest<I> *req = mirror::EnableRequest<I>::create(
-    m_imctx->md_ctx, m_id, cls::rbd::MIRROR_IMAGE_MODE_JOURNAL,
-    m_non_primary_global_image_id, m_imctx->op_work_queue, ctx);
+  auto req = mirror::EnableRequest<I>::create(
+    m_imctx->md_ctx, m_id, m_mirror_image_mode, m_non_primary_global_image_id,
+    m_imctx->op_work_queue, ctx);
   req->send();
 }
 
index 640de9fe0dab988f3f2ae81d03cc4c2da2455118..1bad9945da9cf816ed927f2f4ca0b8eb22b2667e 100644 (file)
@@ -25,13 +25,15 @@ public:
                               uint64_t parent_snap_id,
                               IoCtx &c_ioctx, const std::string &c_name,
                               const std::string &c_id, ImageOptions c_options,
+                              cls::rbd::MirrorImageMode mirror_image_mode,
                              const std::string &non_primary_global_image_id,
                              const std::string &primary_mirror_uuid,
                              ContextWQ *op_work_queue, Context *on_finish) {
     return new CloneRequest(config, parent_io_ctx, parent_image_id,
                             parent_snap_name, parent_snap_id, c_ioctx, c_name,
-                            c_id, c_options, non_primary_global_image_id,
-                            primary_mirror_uuid, op_work_queue, on_finish);
+                            c_id, c_options, mirror_image_mode,
+                            non_primary_global_image_id, primary_mirror_uuid,
+                            op_work_queue, on_finish);
   }
 
   CloneRequest(ConfigProxy& config, IoCtx& parent_io_ctx,
@@ -40,6 +42,7 @@ public:
                uint64_t parent_snap_id,
                IoCtx &c_ioctx, const std::string &c_name,
                const std::string &c_id, ImageOptions c_options,
+               cls::rbd::MirrorImageMode mirror_image_mode,
                const std::string &non_primary_global_image_id,
                const std::string &primary_mirror_uuid,
                ContextWQ *op_work_queue, Context *on_finish);
@@ -108,6 +111,7 @@ private:
   cls::rbd::ParentImageSpec m_pspec;
   ImageCtxT *m_imctx;
   cls::rbd::MirrorMode m_mirror_mode = cls::rbd::MIRROR_MODE_DISABLED;
+  cls::rbd::MirrorImageMode m_mirror_image_mode;
   const std::string m_non_primary_global_image_id;
   const std::string m_primary_mirror_uuid;
   NoOpProgressContext m_no_op;
index 2c497bb157341e35dccbf27629a248542ba07f2d..791fc6254e41f42f4fa9e8da14ebe7bd4e16d199 100644 (file)
@@ -118,14 +118,16 @@ CreateRequest<I>::CreateRequest(const ConfigProxy& config, IoCtx &ioctx,
                                 const std::string &image_name,
                                 const std::string &image_id, uint64_t size,
                                 const ImageOptions &image_options,
+                                bool skip_mirror_enable,
+                                cls::rbd::MirrorImageMode mirror_image_mode,
                                 const std::string &non_primary_global_image_id,
                                 const std::string &primary_mirror_uuid,
-                                bool skip_mirror_enable,
                                 ContextWQ *op_work_queue, Context *on_finish)
   : m_config(config), m_image_name(image_name), m_image_id(image_id),
-    m_size(size), m_non_primary_global_image_id(non_primary_global_image_id),
+    m_size(size), m_skip_mirror_enable(skip_mirror_enable),
+    m_mirror_image_mode(mirror_image_mode),
+    m_non_primary_global_image_id(non_primary_global_image_id),
     m_primary_mirror_uuid(primary_mirror_uuid),
-    m_skip_mirror_enable(skip_mirror_enable),
     m_op_work_queue(op_work_queue), m_on_finish(on_finish) {
 
   m_io_ctx.dup(ioctx);
index 6d5b641de99fa6d6992bc3c465f0761df5d3d710..688e5c632a28ba23a2ddfc6464fd916cd6ad653a 100644 (file)
@@ -29,14 +29,15 @@ public:
                                const std::string &image_name,
                                const std::string &image_id, uint64_t size,
                                const ImageOptions &image_options,
+                               bool skip_mirror_enable,
+                               cls::rbd::MirrorImageMode mirror_image_mode,
                                const std::string &non_primary_global_image_id,
                                const std::string &primary_mirror_uuid,
-                               bool skip_mirror_enable,
                                ContextWQ *op_work_queue, Context *on_finish) {
     return new CreateRequest(config, ioctx, image_name, image_id, size,
-                             image_options, non_primary_global_image_id,
-                             primary_mirror_uuid, skip_mirror_enable,
-                             op_work_queue, on_finish);
+                             image_options, skip_mirror_enable,
+                             mirror_image_mode, non_primary_global_image_id,
+                             primary_mirror_uuid, op_work_queue, on_finish);
   }
 
   static int validate_order(CephContext *cct, uint8_t order);
@@ -90,9 +91,10 @@ private:
                 const std::string &image_name,
                 const std::string &image_id, uint64_t size,
                 const ImageOptions &image_options,
+                bool skip_mirror_enable,
+                cls::rbd::MirrorImageMode mirror_image_mode,
                 const std::string &non_primary_global_image_id,
                 const std::string &primary_mirror_uuid,
-                bool skip_mirror_enable,
                 ContextWQ *op_work_queue, Context *on_finish);
 
   const ConfigProxy& m_config;
@@ -110,9 +112,10 @@ private:
   std::string m_journal_pool;
   std::string m_data_pool;
   int64_t m_data_pool_id = -1;
+  bool m_skip_mirror_enable;
+  cls::rbd::MirrorImageMode m_mirror_image_mode;
   const std::string m_non_primary_global_image_id;
   const std::string m_primary_mirror_uuid;
-  bool m_skip_mirror_enable;
   bool m_negotiate_features = false;
 
   ContextWQ *m_op_work_queue;
index 62c4d461c48dcc49f3ded296af96c438eaf662ab..97f3205e6ef21634e62f40d167446ff7a1a82164 100644 (file)
@@ -687,8 +687,9 @@ int validate_pool(IoCtx &io_ctx, CephContext *cct) {
 
       C_SaferCond cond;
       image::CreateRequest<> *req = image::CreateRequest<>::create(
-        config, io_ctx, image_name, id, size, opts, non_primary_global_image_id,
-        primary_mirror_uuid, skip_mirror_enable, op_work_queue, &cond);
+        config, io_ctx, image_name, id, size, opts, skip_mirror_enable,
+        cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, non_primary_global_image_id,
+        primary_mirror_uuid, op_work_queue, &cond);
       req->send();
 
       r = cond.wait();
@@ -781,8 +782,8 @@ int validate_pool(IoCtx &io_ctx, CephContext *cct) {
     C_SaferCond cond;
     auto *req = image::CloneRequest<>::create(
       config, p_ioctx, parent_id, p_snap_name, CEPH_NOSNAP, c_ioctx, c_name,
-      clone_id, c_opts, non_primary_global_image_id, primary_mirror_uuid,
-      op_work_queue, &cond);
+      clone_id, c_opts, cls::rbd::MIRROR_IMAGE_MODE_JOURNAL,
+      non_primary_global_image_id, primary_mirror_uuid, op_work_queue, &cond);
     req->send();
 
     r = cond.wait();
index 1246836e07acb7ce02dfc92f37826be2f2cec705..c9af674bad0f619684982af4478cfb85783f378e 100644 (file)
@@ -106,9 +106,10 @@ struct CreateRequest<MockTestImageCtx> {
                                const std::string &image_name,
                                const std::string &image_id, uint64_t size,
                                const ImageOptions &image_options,
+                               bool skip_mirror_enable,
+                               cls::rbd::MirrorImageMode mode,
                                const std::string &non_primary_global_image_id,
                                const std::string &primary_mirror_uuid,
-                               bool skip_mirror_enable,
                                ContextWQ *op_work_queue,
                                Context *on_finish) {
     ceph_assert(s_instance != nullptr);
@@ -400,7 +401,8 @@ TEST_F(TestMockImageCloneRequest, SuccessV1) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(0, ctx.wait());
 }
@@ -449,7 +451,8 @@ TEST_F(TestMockImageCloneRequest, SuccessV2) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(0, ctx.wait());
 }
@@ -498,7 +501,8 @@ TEST_F(TestMockImageCloneRequest, SuccessAuto) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(0, ctx.wait());
 }
@@ -516,7 +520,8 @@ TEST_F(TestMockImageCloneRequest, OpenParentError) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
@@ -542,7 +547,8 @@ TEST_F(TestMockImageCloneRequest, CreateError) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
@@ -573,7 +579,8 @@ TEST_F(TestMockImageCloneRequest, OpenError) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
@@ -609,7 +616,8 @@ TEST_F(TestMockImageCloneRequest, AttachParentError) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
@@ -648,7 +656,8 @@ TEST_F(TestMockImageCloneRequest, AttachChildError) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
@@ -689,7 +698,8 @@ TEST_F(TestMockImageCloneRequest, MetadataListError) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
@@ -731,7 +741,8 @@ TEST_F(TestMockImageCloneRequest, MetadataSetError) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
@@ -775,7 +786,8 @@ TEST_F(TestMockImageCloneRequest, GetMirrorModeError) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
@@ -822,7 +834,8 @@ TEST_F(TestMockImageCloneRequest, MirrorEnableError) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
@@ -864,7 +877,8 @@ TEST_F(TestMockImageCloneRequest, CloseError) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
@@ -895,7 +909,8 @@ TEST_F(TestMockImageCloneRequest, RemoveError) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
@@ -926,7 +941,8 @@ TEST_F(TestMockImageCloneRequest, CloseParentError) {
   ImageOptions clone_opts;
   auto req = new MockCloneRequest(m_cct->_conf, m_ioctx, "parent id", "", 123,
                                   m_ioctx, "clone name", "clone id", clone_opts,
-                                  "", "", image_ctx->op_work_queue, &ctx);
+                                  cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, "", "",
+                                  image_ctx->op_work_queue, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
index ac014be831d592fbeefc8b72b9ce4850f9733e4e..896aa03e7d795548351514ef7ed78ba6a4816a7e 100644 (file)
@@ -40,9 +40,10 @@ struct CreateRequest<librbd::MockTestImageCtx> {
                                const std::string &imgname,
                                const std::string &imageid, uint64_t size,
                                const librbd::ImageOptions &image_options,
+                               bool skip_mirror_enable,
+                               cls::rbd::MirrorImageMode mode,
                                const std::string &non_primary_global_image_id,
                                const std::string &primary_mirror_uuid,
-                               bool skip_mirror_enable,
                                MockContextWQ *op_work_queue,
                                Context *on_finish) {
     ceph_assert(s_instance != nullptr);
@@ -80,6 +81,7 @@ struct CloneRequest<librbd::MockTestImageCtx> {
                               uint64_t p_snap_id,
                              IoCtx &c_ioctx, const std::string &c_name,
                              const std::string &c_id, ImageOptions c_options,
+                              cls::rbd::MirrorImageMode mode,
                              const std::string &non_primary_global_image_id,
                              const std::string &primary_mirror_uuid,
                              MockContextWQ *op_work_queue,
index 84973676edc44b365c4631769fc6780d088b7933..23dde23ec9976826822403acf64e21ffa6a31a6b 100644 (file)
@@ -83,8 +83,9 @@ void CreateImageRequest<I>::create_image() {
 
   auto req = librbd::image::CreateRequest<I>::create(
     config, m_local_io_ctx, m_local_image_name, m_local_image_id,
-    m_remote_image_ctx->size, image_options, m_global_image_id,
-    m_remote_mirror_uuid, false, m_remote_image_ctx->op_work_queue, ctx);
+    m_remote_image_ctx->size, image_options, false,
+    cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, m_global_image_id,
+    m_remote_mirror_uuid, m_remote_image_ctx->op_work_queue, ctx);
   req->send();
 }
 
@@ -345,8 +346,8 @@ void CreateImageRequest<I>::clone_image() {
   librbd::image::CloneRequest<I> *req = librbd::image::CloneRequest<I>::create(
     config, m_local_parent_io_ctx, m_local_parent_spec.image_id, snap_name,
     CEPH_NOSNAP, m_local_io_ctx, m_local_image_name, m_local_image_id, opts,
-    m_global_image_id, m_remote_mirror_uuid, m_remote_image_ctx->op_work_queue,
-    ctx);
+    cls::rbd::MIRROR_IMAGE_MODE_JOURNAL, m_global_image_id,
+    m_remote_mirror_uuid, m_remote_image_ctx->op_work_queue, ctx);
   req->send();
 }