Skip to content

Commit

Permalink
rbd-mirror: don't return split-brain error if we still in MIRROR_PEER…
Browse files Browse the repository at this point in the history
…_STATE_SYNCING

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
  • Loading branch information
Mykola Golub committed Jun 5, 2016
1 parent 039cd2d commit 3ac620c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/test/rbd_mirror/test_ImageReplayer.cc
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc
Expand Up @@ -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;
Expand Down

0 comments on commit 3ac620c

Please sign in to comment.