]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: additional debug messages during image replayer start/stop
authorJason Dillaman <dillaman@redhat.com>
Wed, 18 May 2016 15:01:22 +0000 (11:01 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 20 May 2016 13:01:53 +0000 (09:01 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit afc891f7fcb000d106b1d722386f6d81ddeddab6)

src/tools/rbd_mirror/ImageReplayer.h
src/tools/rbd_mirror/Replayer.cc

index f832741e9ea113e424cff51c0b39dfbeda207232..3dc12879683033d07efb5ccac6025f927c798a22 100644 (file)
@@ -101,6 +101,9 @@ public:
   virtual void handle_replay_ready();
   virtual void handle_replay_complete(int r, const std::string &error_desc);
 
+  inline const std::string get_global_image_id() const {
+    return m_global_image_id;
+  }
   inline int64_t get_remote_pool_id() const {
     return m_remote_pool_id;
   }
index 54a003d7044d7240fa9c515abc5d814552707d40..fc92413f230b378e446806160c87f7012821c91c 100644 (file)
@@ -473,8 +473,13 @@ void Replayer::set_sources(const PoolImageIds &pool_image_ids)
 
     // pool has no mirrored images
     if (pool_image_ids.find(pool_id) == pool_image_ids.end()) {
+      dout(20) << "pool " << pool_id << " has no mirrored images" << dendl;
       for (auto images_it = pool_images.begin();
           images_it != pool_images.end();) {
+        if (images_it->second->is_running()) {
+          dout(20) << "stop image replayer for "
+                   << images_it->second->get_global_image_id() << dendl;
+        }
        if (stop_image_replayer(images_it->second)) {
          images_it = pool_images.erase(images_it);
        } else {
@@ -495,6 +500,10 @@ void Replayer::set_sources(const PoolImageIds &pool_image_ids)
         images_it != pool_images.end();) {
       auto &image_ids = pool_image_ids.at(pool_id);
       if (image_ids.find(ImageIds(images_it->first)) == image_ids.end()) {
+        if (images_it->second->is_running()) {
+          dout(20) << "stop image replayer for "
+                   << images_it->second->get_global_image_id() << dendl;
+        }
        if (stop_image_replayer(images_it->second)) {
          images_it = pool_images.erase(images_it);
        } else {
@@ -563,6 +572,10 @@ void Replayer::set_sources(const PoolImageIds &pool_image_ids)
        it = pool_replayers.insert(
          std::make_pair(image_id.id, std::move(image_replayer))).first;
       }
+      if (!it->second->is_running()) {
+        dout(20) << "starting image replayer for "
+                 << it->second->get_global_image_id() << dendl;
+      }
       start_image_replayer(it->second);
     }
   }