]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: fix issues with rebase
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 13 Mar 2025 17:21:22 +0000 (22:51 +0530)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 24 Apr 2025 15:56:34 +0000 (21:26 +0530)
* revert changes to remote_namespace_set
* revert change in PoolWatcher<I>::notify_listener()

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
src/librbd/api/Mirror.cc
src/tools/rbd_mirror/PoolWatcher.cc

index 24136f21c8e9013228ce7c45c0af4df4d3924139..73f7fa9bb4b1ed1588f1d694ac0794fba6d4efc0 100644 (file)
@@ -1576,20 +1576,6 @@ int Mirror<I>::remote_namespace_set(librados::IoCtx& io_ctx,
   CephContext *cct = reinterpret_cast<CephContext *>(io_ctx.cct());
   ldout(cct, 20) << dendl;
 
-  std::string local_namespace = io_ctx.get_namespace();
-
-  if (local_namespace.empty() && !remote_namespace.empty()) {
-    lderr(cct) << "cannot mirror the default namespace to a "
-               << "non-default namespace." << dendl;
-    return -EINVAL;
-  }
-
-  if (!local_namespace.empty() && remote_namespace.empty()) {
-    lderr(cct) << "cannot mirror a non-default namespace to the default "
-               << "namespace." << dendl;
-    return -EINVAL;
-  }
-
   int r = cls_client::mirror_remote_namespace_set(&io_ctx, remote_namespace);
   if (r < 0) {
     lderr(cct) << "failed to set remote mirror namespace: "
index c6ebd5e7a9c0608b199e04060a42dae6d32c34d9..24c0dbeb8ca3e721273db8bbfead2233918d3756 100644 (file)
@@ -464,8 +464,8 @@ void PoolWatcher<I>::notify_listener() {
       auto it = m_entities.find(entity);
       if (it != m_entities.end()) {
         m_entities.erase(entity);
+        m_entities.insert({entity, id});
       }
-      m_entities.insert({entity, id});
     }
     m_pending_removed_entities.clear();