]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: provide instance_id for `ceph service status`
authorMykola Golub <mgolub@suse.com>
Wed, 24 Oct 2018 10:11:48 +0000 (13:11 +0300)
committerMykola Golub <mgolub@suse.com>
Sat, 3 Nov 2018 08:20:42 +0000 (10:20 +0200)
Signed-off-by: Mykola Golub <mgolub@suse.com>
src/tools/rbd_mirror/PoolReplayer.cc

index a98a101f983031b5fe399430ea25d827852e872e..c15f565b677e54390ec68f4f491cb9d3e79616be 100644 (file)
@@ -1,4 +1,4 @@
-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #include "PoolReplayer.h"
@@ -47,6 +47,7 @@ using ::operator<<;
 
 namespace {
 
+const std::string SERVICE_DAEMON_INSTANCE_ID_KEY("instance_id");
 const std::string SERVICE_DAEMON_LEADER_KEY("leader");
 const std::string SERVICE_DAEMON_LOCAL_COUNT_KEY("image_local_count");
 const std::string SERVICE_DAEMON_REMOTE_COUNT_KEY("image_remote_count");
@@ -350,6 +351,9 @@ void PoolReplayer<I>::init()
       "unable to initialize instance messenger object");
     return;
   }
+  m_service_daemon->add_or_update_attribute(
+      m_local_pool_id, SERVICE_DAEMON_INSTANCE_ID_KEY,
+      m_instance_watcher->get_instance_id());
 
   m_leader_watcher.reset(LeaderWatcher<I>::create(m_threads, m_local_io_ctx,
                                                   &m_leader_listener));