MOCK_METHOD1(open, void(Context *));
MOCK_METHOD1(close, void(Context *));
+ MOCK_CONST_METHOD0(get_tag_tid, uint64_t());
MOCK_CONST_METHOD0(get_tag_data, journal::TagData());
MOCK_METHOD0(allocate_op_tid, uint64_t());
predecessor_mirror_uuid = librbd::Journal<>::LOCAL_MIRROR_UUID;
}
+ dout(20) << "mirror_uuid=" << mirror_uuid << ", "
+ << "predecessor_mirror_uuid=" << predecessor_mirror_uuid << ", "
+ << "replay_tag_tid=" << m_replay_tag_tid << ", "
+ << "replay_tag_data=" << m_replay_tag_data << dendl;
Context *ctx = create_context_callback<
ImageReplayer, &ImageReplayer<I>::handle_allocate_local_tag>(this);
m_local_journal->allocate_tag(
bufferlist::iterator it = tag.data.begin();
::decode(remote_tag_data, it);
} catch (const buffer::error &err) {
- derr << ": failed to decode remote tag: " << err.what() << dendl;
+ derr << ": failed to decode remote tag " << tag.tid << ": "
+ << err.what() << dendl;
m_ret_val = -EBADMSG;
close_local_image();
return;
}
- dout(10) << ": decoded remote tag: " << remote_tag_data << dendl;
+ dout(10) << ": decoded remote tag " << tag.tid << ": "
+ << remote_tag_data << dendl;
if (remote_tag_data.mirror_uuid == librbd::Journal<>::ORPHAN_MIRROR_UUID &&
remote_tag_data.predecessor_mirror_uuid == m_local_mirror_uuid) {
// remote tag is chained off a local tag demotion
return;
}
- librbd::journal::TagData tag_data =
+ uint64_t local_tag_tid = local_image_ctx->journal->get_tag_tid();
+ librbd::journal::TagData local_tag_data =
local_image_ctx->journal->get_tag_data();
- dout(20) << ": local tag data: " << tag_data << dendl;
+ dout(20) << ": local tag " << local_tag_tid << ": "
+ << local_tag_data << dendl;
- if (tag_data.mirror_uuid == librbd::Journal<>::ORPHAN_MIRROR_UUID &&
+ if (local_tag_data.mirror_uuid == librbd::Journal<>::ORPHAN_MIRROR_UUID &&
remote_tag_data.mirror_uuid == librbd::Journal<>::ORPHAN_MIRROR_UUID &&
remote_tag_data.predecessor_mirror_uuid == m_local_mirror_uuid) {
dout(20) << ": local image was demoted" << dendl;
- } else if (tag_data.mirror_uuid == m_remote_mirror_uuid &&
+ } else if (local_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) {