]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: avoid bootstrap creating a local non_primary group snapshot
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 20 Mar 2025 07:00:23 +0000 (12:30 +0530)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 24 Apr 2025 15:56:35 +0000 (21:26 +0530)
previously we are bound to this but with the current design we no more need it.

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
src/tools/rbd_mirror/group_replayer/BootstrapRequest.cc
src/tools/rbd_mirror/group_replayer/BootstrapRequest.h

index 7b1cdf473f679af6ea20bf7e8b3df0e43ddda903..bbc69bcabf9d231312733c4f239c32dd3a3d534c 100644 (file)
@@ -1258,57 +1258,6 @@ void BootstrapRequest<I>::handle_create_local_mirror_group(int r) {
     return;
   }
 
-  create_local_non_primary_group_snapshot();
-}
-
-template <typename I>
-void BootstrapRequest<I>::create_local_non_primary_group_snapshot() {
-  dout(10) << dendl;
-
-  RemotePoolMeta remote_pool_meta;
-  int r = m_pool_meta_cache->get_remote_pool_meta(m_remote_io_ctx.get_id(),
-                                                  &remote_pool_meta);
-  if (r < 0 || remote_pool_meta.mirror_peer_uuid.empty()) {
-    derr << "failed to retrieve mirror peer uuid from remote image pool"
-         << dendl;
-    finish(r < 0 ? r : -EINVAL);
-    return;
-  }
-
-  librados::ObjectWriteOperation op;
-  std::string group_snap_id = librbd::util::generate_image_id(m_local_io_ctx);
-  cls::rbd::GroupSnapshot group_snap{
-    group_snap_id,
-    cls::rbd::GroupSnapshotNamespaceMirror{
-      cls::rbd::MIRROR_SNAPSHOT_STATE_NON_PRIMARY,
-      {}, remote_pool_meta.mirror_peer_uuid, {}},
-      prepare_non_primary_mirror_snap_name(m_global_group_id, group_snap_id),
-      cls::rbd::GROUP_SNAPSHOT_STATE_INCOMPLETE};
-  librbd::cls_client::group_snap_set(&op, group_snap);
-  group_snap.state = cls::rbd::GROUP_SNAPSHOT_STATE_COMPLETE;
-  librbd::cls_client::group_snap_set(&op, group_snap);
-
-  auto comp = create_rados_callback<
-      BootstrapRequest<I>,
-      &BootstrapRequest<I>::handle_create_local_non_primary_group_snapshot>(this);
-
-  r = m_local_io_ctx.aio_operate(
-      librbd::util::group_header_name(*m_local_group_id), comp, &op);
-  ceph_assert(r == 0);
-  comp->release();
-}
-
-template <typename I>
-void BootstrapRequest<I>::handle_create_local_non_primary_group_snapshot(int r) {
-  dout(10) << "r=" << r << dendl;
-
-  if (r < 0) {
-    derr << "error creating local non-primary group snapshot: "
-         << cpp_strerror(r) << dendl;
-    finish(r);
-    return;
-  }
-
   notify_mirroring_watcher();
 }
 
index 0f6fcc6f64bd90282dbc9e2bd04d4eedf145a30e..2a10951b65fcfb117b538ab6a78d063e7e7ed10f 100644 (file)
@@ -146,7 +146,7 @@ private:
    *    |  REMOVE_LOCAL_MIRROR_GROUP ----> CREATE_LOCAL_MIRROR_GROUP
    *    |     |                   (if stale)  |
    *    |     v                               v
-   *    |  REMOVE_LOCAL_GROUP              CREATE_LOCAL_NON_PRIMARY_GROUP_SNAPSHOT
+   *    |  REMOVE_LOCAL_GROUP              NOFTIFY_MIRRORING_WATCHER
    *    |     |        (if removing)          |
    *    |     v                               |
    *    |  REMOVE_LOCAL_GROUP_ID              |
@@ -269,9 +269,6 @@ private:
   void create_local_mirror_group();
   void handle_create_local_mirror_group(int r);
 
-  void create_local_non_primary_group_snapshot();
-  void handle_create_local_non_primary_group_snapshot(int r);
-
   void notify_mirroring_watcher();
   void handle_notify_mirroring_watcher(int r);