From: Jason Dillaman Date: Wed, 16 Mar 2016 12:33:03 +0000 (-0400) Subject: journal: refetch active object before defaulting to new tag X-Git-Tag: v10.1.0~63^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3cf8952559e2ac43487d2e347e1041722ee1ecd9;p=ceph.git journal: refetch active object before defaulting to new tag If a live replay is in progress, it's possible that object offset 0 was pulled and a new tag is discovered before the current object is (re-)pulled to determine that the old tag still has entries remaining. Signed-off-by: Jason Dillaman --- diff --git a/src/journal/JournalPlayer.cc b/src/journal/JournalPlayer.cc index 4d6382cc4bf2..0d6b1776ac49 100644 --- a/src/journal/JournalPlayer.cc +++ b/src/journal/JournalPlayer.cc @@ -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(m_splay_offset) << dendl; } diff --git a/src/journal/JournalPlayer.h b/src/journal/JournalPlayer.h index 902a1959d95b..476b49b5acb4 100644 --- a/src/journal/JournalPlayer.h +++ b/src/journal/JournalPlayer.h @@ -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;