]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: improved debug logs on list watcher state machine
authorJason Dillaman <dillaman@redhat.com>
Tue, 4 Aug 2020 21:19:21 +0000 (17:19 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 16 Sep 2020 17:19:29 +0000 (13:19 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit aee199f1daea6fd8eb7671464e45154ed0e9fd65)
(cherry picked from commit dc0b7a0006c956ada842118744ad2768ff9984a5)

Conflicts:
src/librbd/image/ListWatchersRequest.cc: dropped mirroring filter

src/librbd/image/ListWatchersRequest.cc

index ad3a20caf0ba1243141c0282ff2db2acb545c7aa..e93fffc1515abed02e34188577222981be500dd9 100644 (file)
 #define dout_prefix *_dout << "librbd::image::ListWatchersRequest: " << this \
                            << " " << __func__ << ": "
 
+static std::ostream& operator<<(std::ostream& os, const obj_watch_t& watch) {
+  os << "{addr=" << watch.addr << ", "
+     << "watcher_id=" << watch.watcher_id << ", "
+     << "cookie=" << watch.cookie << "}";
+  return os;
+}
+
 namespace librbd {
 namespace image {
 
@@ -69,6 +76,7 @@ void ListWatchersRequest<I>::handle_list_image_watchers(int r) {
     return;
   }
 
+  ldout(m_cct, 20) << "object_watchers=" << m_object_watchers << dendl;
   list_mirror_watchers();
 }
 
@@ -107,6 +115,8 @@ void ListWatchersRequest<I>::handle_list_mirror_watchers(int r) {
     ldout(m_cct, 1) << "error listing mirror watchers: " << cpp_strerror(r)
                     << dendl;
   }
+
+  ldout(m_cct, 20) << "mirror_watchers=" << m_mirror_watchers << dendl;
   finish(0);
 }
 
@@ -125,6 +135,7 @@ void ListWatchersRequest<I>::finish(int r) {
       for (auto &w : m_object_watchers) {
         if ((m_flags & LIST_WATCHERS_FILTER_OUT_MY_INSTANCE) != 0) {
           if (w.cookie == watch_handle) {
+            ldout(m_cct, 20) << "filtering out my instance: " << w << dendl;
             continue;
           }
         }
@@ -136,6 +147,7 @@ void ListWatchersRequest<I>::finish(int r) {
                                                    sizeof(w.addr)) == 0);
                                  });
           if (it != m_mirror_watchers.end()) {
+            ldout(m_cct, 20) << "filtering out mirror instance: " << w << dendl;
             continue;
           }
         }