]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
journal: refetch active object before defaulting to new tag
authorJason Dillaman <dillaman@redhat.com>
Wed, 16 Mar 2016 12:33:03 +0000 (08:33 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 16 Mar 2016 14:01:38 +0000 (10:01 -0400)
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 <dillaman@redhat.com>
src/journal/JournalPlayer.cc
src/journal/JournalPlayer.h

index 4d6382cc4bf2ac59d67811b3e3ffe933045f3056..0d6b1776ac49ffae558069637d15efca7cfeca94 100644 (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;
 }
index 902a1959d95b045975d1b388eaa4ab6c352d662e..476b49b5acb422e293e9394997b42831a928846e 100644 (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;