]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: resync was possible only when image replayer start had succeeded
authorMykola Golub <mgolub@mirantis.com>
Wed, 10 Aug 2016 08:22:16 +0000 (11:22 +0300)
committerMykola Golub <mgolub@mirantis.com>
Mon, 5 Sep 2016 05:51:54 +0000 (08:51 +0300)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/tools/rbd_mirror/ImageReplayer.cc

index 719a2c042a87ef2d94e09f4e5aa80cee8e4434ea..3a78457c0d7ed281cb6166ccb676631e5fcbfd07 100644 (file)
@@ -455,7 +455,14 @@ void ImageReplayer<I>::handle_bootstrap(int r) {
 
     if (do_resync) {
       Context *on_finish = m_on_start_finish;
+      m_stopping_for_resync = true;
       FunctionContext *ctx = new FunctionContext([this, on_finish](int r) {
+         if (r < 0) {
+           if (on_finish) {
+             on_finish->complete(r);
+           }
+           return;
+         }
           resync_image(on_finish);
         });
       m_on_start_finish = ctx;