]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/mirror: leave non-primary snapshot images in creating state 39439/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 11 Feb 2021 20:54:01 +0000 (15:54 -0500)
committerJason Dillaman <dillaman@redhat.com>
Mon, 22 Feb 2021 13:17:36 +0000 (08:17 -0500)
The creating state is a special case in rbd-mirror where it will
automatically delete the image since it assumes it's malformed.
A non-primary, snapshot-based mirror image needs to have at least
one non-primary snapshot and the first one is not created until
after replay has started. Now rbd-mirror will update the mirror
image state to the enabled state after creating the first
non-primary snapshot but before attempting the sync.

Fixes: https://tracker.ceph.com/issues/49238
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 43f2c208fa3042d93e4810d804ffe28e9ca7af77)

src/librbd/mirror/EnableRequest.cc
src/librbd/mirror/EnableRequest.h

index c7f7d8746f0d7ce9ce6f528994556495d29bd8ac..fd74a25ba65515d91076b8e99edb9916f9e7a787 100644 (file)
@@ -288,7 +288,7 @@ void EnableRequest<I>::handle_enable_non_primary_feature(int r) {
     return;
   }
 
-  image_state_update();
+  finish(0);
 }
 
 template <typename I>
index 64f410a8e066e671eb2d188b92b787c6416a90a2..391028e6e5db3c4b66286332a94028304ac7d7fa 100644 (file)
@@ -69,7 +69,7 @@ private:
    *    v (skip if not needed)    *
    * ENABLE_NON_PRIMARY_FEATURE   *
    *    |                         *
-   *    v                         *
+   *    v (skip if not needed)    *
    * IMAGE_STATE_UPDATE * * * * * *
    *    |                         *
    *    v                         *