Merge pull request #8158 from dillaman/wip-rbd-mirror-fixes

rbd-mirror: fix image replay test failures

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Josh Durgin 2016-03-16 09:41:04 -07:00
commit 188644cb75
3 changed files with 13 additions and 3 deletions

View File

@ -35,7 +35,7 @@
#
# cd /tmp/tmp.rbd_mirror
# ls
# less rbd-mirror.log
# less rbd-mirror.<pid>.log
# ceph --cluster remote -s
# ceph --cluster local -s
# rbd --cluster remote -p mirror ls
@ -120,7 +120,7 @@ start_mirror()
rbd-mirror \
--cluster ${LOC_CLUSTER} \
--pid-file=${RBD_MIRROR_PID_FILE} \
--log-file=${TEMPDIR}/rbd-mirror.log \
--log-file=${TEMPDIR}/rbd-mirror.\$pid.log \
--admin-socket=${RBD_MIRROR_ASOK} \
--debug-rbd=30 --debug-journaler=30 \
--debug-rbd_mirror=30 \
@ -290,7 +290,7 @@ image_id()
local cluster=$1
local image=$2
rbd --cluster ${cluster} -p ${POOL} info --image test |
rbd --cluster ${cluster} -p ${POOL} info --image ${image} |
sed -ne 's/^.*block_name_prefix: rbd_data\.//p'
}

View File

@ -392,6 +392,14 @@ bool JournalPlayer::verify_playback_ready() {
}
}
// if we just advanced to this object, make sure we have the latest
// set of data before advancing to a new tag
if (m_watch_enabled && m_watch_required) {
m_watch_required = false;
schedule_watch();
return false;
}
// NOTE: replay currently does not check tag class to playback multiple tags
// from different classes (issue #14909). When a new tag is discovered, it
// is assumed that the previous tag was closed at the last replayable entry.
@ -443,6 +451,7 @@ void JournalPlayer::advance_splay_object() {
assert(m_lock.is_locked());
++m_splay_offset;
m_splay_offset %= m_journal_metadata->get_splay_width();
m_watch_required = true;
ldout(m_cct, 20) << __func__ << ": new offset "
<< static_cast<uint32_t>(m_splay_offset) << dendl;
}

View File

@ -112,6 +112,7 @@ private:
bool m_watch_enabled;
bool m_watch_scheduled;
double m_watch_interval;
bool m_watch_required = false;
bool m_handler_notified = false;