]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: align GroupReplayer register admin_socket_hook with ImageReplayer
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Tue, 25 Feb 2025 11:46:15 +0000 (17:16 +0530)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 24 Apr 2025 15:56:31 +0000 (21:26 +0530)
This will fix the following failing tests with asok issues:

rbd_mirror_group_simple.sh:
+ testlog 'TEST:test_multiple_user_snapshot_time scenario:1 parameters:'

rbd_mirror_group_group.sh:
+ testlog "TEST: add a large image to group and test replay"

Also this fix replace the set_finished(), which was removed in the previous
commit, which will cause a regression in the GroupReplayer destroy code path.

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

index 5072bbf3ca344ea8efc8a7fd4776676d025a166e..6dfda75c19d18558d285dbc193b77773b85d154d 100644 (file)
@@ -801,6 +801,13 @@ void GroupReplayer<I>::handle_shut_down(int r) {
     m_state = STATE_STOPPED;
   }
 
+  if (r == -ENOENT) { // group removed
+    if (!m_resync_requested) {
+      set_finished(true);
+    }
+    unregister_admin_socket_hook();
+  }
+
   if (on_start != nullptr) {
     dout(10) << "on start finish complete, r=" << r << dendl;
     on_start->complete(r);
@@ -876,6 +883,8 @@ void GroupReplayer<I>::set_mirror_group_status_update(
     cls::rbd::MirrorGroupStatusState state, const std::string &desc) {
   dout(20) << "state=" << state << ", description=" << desc << dendl;
 
+  reregister_admin_socket_hook();
+
   cls::rbd::MirrorGroupSiteStatus local_status;
   local_status.state = state;
   local_status.description = desc;