From: Jason Dillaman Date: Thu, 16 Jun 2016 14:37:56 +0000 (-0400) Subject: journal: do not log watch errors against deleted journal X-Git-Tag: v11.0.0~141^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F9751%2Fhead;p=ceph.git journal: do not log watch errors against deleted journal 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 --- diff --git a/src/journal/JournalMetadata.cc b/src/journal/JournalMetadata.cc index 18bef13b0f99..ed586a350ed7 100644 --- a/src/journal/JournalMetadata.cc +++ b/src/journal/JournalMetadata.cc @@ -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);