]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: don't return split-brain error if we still in MIRROR_PEER_STATE_SYNCING 9612/head
authorMykola Golub <mgolub@mirantis.com>
Wed, 4 May 2016 12:30:05 +0000 (15:30 +0300)
committerJason Dillaman <dillaman@redhat.com>
Thu, 9 Jun 2016 18:11:59 +0000 (14:11 -0400)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
(cherry picked from commit 3ac620c5d66d8516e68264fcdb5e97b0e803d0ec)

src/test/rbd_mirror/test_ImageReplayer.cc
src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc

index 6aec1dd016d864e762cc9374de1c74effe6550eb..c2753bae4ef5bce6d9ea6070919a49c82dccdbe6 100644 (file)
@@ -400,15 +400,12 @@ TEST_F(TestImageReplayer, StartInterrupted)
   ASSERT_EQ(0, stop_cond.wait());
 }
 
-TEST_F(TestImageReplayer, ErrorJournalReset)
+TEST_F(TestImageReplayer, JournalReset)
 {
   bootstrap();
-
   ASSERT_EQ(0, librbd::Journal<>::reset(m_remote_ioctx, m_remote_image_id));
-
-  C_SaferCond cond;
-  m_replayer->start(&cond);
-  ASSERT_EQ(-EEXIST, cond.wait());
+  // try to recover
+  bootstrap();
 }
 
 TEST_F(TestImageReplayer, ErrorNoJournal)
index 4c1278401a6018b9888b623ffe3ae1c1b1590c24..a3ab50d93280c8b41cb4db831683ad9f2a86df70 100644 (file)
@@ -516,6 +516,8 @@ void BootstrapRequest<I>::handle_get_remote_tags(int r) {
     } else if (tag_data.mirror_uuid == m_remote_mirror_uuid &&
               m_client_meta->state == librbd::journal::MIRROR_PEER_STATE_REPLAYING) {
       dout(20) << ": local image is in clean replay state" << dendl;
+    } else if (m_client_meta->state == librbd::journal::MIRROR_PEER_STATE_SYNCING) {
+      dout(20) << ": previous sync was canceled" << dendl;
     } else {
       derr << ": split-brain detected -- skipping image replay" << dendl;
       m_ret_val = -EEXIST;