]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: avoid stuck group on secondary
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 6 Mar 2025 07:19:15 +0000 (12:49 +0530)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 24 Apr 2025 15:56:32 +0000 (21:26 +0530)
The following steps leaves stale group on seondary left undeleted,
1. Create and mirror enable a group with 2 images.
2. Let it sync to the secondary
3. Demote on the primary and promote on the secondary
4. Wait until it starts replaying on the original primary
5. Delete the group on the new primary

Credits to Nithya Balachandran for highlighting the issue with detailed steps.

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

index 9f278dccf2b9359965a56a2d7829a8337a7d91cd..2b71f9c8ca2f42820a6920a6f2100ad93dec5197 100644 (file)
@@ -307,7 +307,7 @@ void Replayer<I>::handle_load_local_group_snapshots(int r) {
   if (r < 0) {
     derr << "error listing local mirror group snapshots: " << cpp_strerror(r)
          << dendl;
-    schedule_load_group_snapshots();
+    notify_group_listener_stop();
     return;
   }
 
@@ -360,10 +360,10 @@ void Replayer<I>::handle_load_remote_group_snapshots(int r) {
   }
   m_in_flight_op_tracker.finish_op();
 
-  if (r < 0) {
+  if (r < 0) {  // may be remote group is deleted?
     derr << "error listing remote mirror group snapshots: " << cpp_strerror(r)
          << dendl;
-    load_remote_group_snapshots();
+    notify_group_listener_stop();
     return;
   }