]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
journal: do not log watch errors against deleted journal 10042/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 16 Jun 2016 14:37:56 +0000 (10:37 -0400)
committerLoic Dachary <ldachary@redhat.com>
Thu, 30 Jun 2016 07:14:50 +0000 (09:14 +0200)
The peer rbd-mirror process will eventually notice that the journal has
been removed and clean itself up. This avoids flooding the log with
expected error messages when journaling is disabled.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 8317ce1611c39ad6a58bf2d760a010587d91ec60)

src/journal/JournalMetadata.cc

index 18bef13b0f998d7e1b44907211b4a5e4247af171..ed586a350ed724c01fec46a34dc512add1f7235f 100644 (file)
@@ -824,7 +824,7 @@ void JournalMetadata::handle_commit_position_task() {
 
 void JournalMetadata::schedule_watch_reset() {
   assert(m_timer_lock->is_locked());
-  m_timer->add_event_after(0.1, new C_WatchReset(this));
+  m_timer->add_event_after(1, new C_WatchReset(this));
 }
 
 void JournalMetadata::handle_watch_reset() {
@@ -835,8 +835,12 @@ void JournalMetadata::handle_watch_reset() {
 
   int r = m_ioctx.watch2(m_oid, &m_watch_handle, &m_watch_ctx);
   if (r < 0) {
-    lderr(m_cct) << __func__ << ": failed to watch journal"
-                 << cpp_strerror(r) << dendl;
+    if (r == -ENOENT) {
+      ldout(m_cct, 5) << __func__ << ": journal header not found" << dendl;
+    } else {
+      lderr(m_cct) << __func__ << ": failed to watch journal"
+                   << cpp_strerror(r) << dendl;
+    }
     schedule_watch_reset();
   } else {
     ldout(m_cct, 10) << __func__ << ": reset journal watch" << dendl;
@@ -854,7 +858,12 @@ void JournalMetadata::handle_watch_notify(uint64_t notify_id, uint64_t cookie) {
 }
 
 void JournalMetadata::handle_watch_error(int err) {
-  lderr(m_cct) << "journal watch error: " << cpp_strerror(err) << dendl;
+  if (err == -ENOTCONN) {
+    ldout(m_cct, 5) << "journal watch error: header removed" << dendl;
+  } else {
+    lderr(m_cct) << "journal watch error: " << cpp_strerror(err) << dendl;
+  }
+
   Mutex::Locker timer_locker(*m_timer_lock);
   Mutex::Locker locker(m_lock);