From: Jason Dillaman Date: Thu, 24 May 2018 14:02:27 +0000 (-0400) Subject: rbd-mirror: always send image RPC messages via cluster X-Git-Tag: v14.0.1~169^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9edcd77a8333967da057eff049e53d34ee8422cd;p=ceph.git rbd-mirror: always send image RPC messages via cluster Signed-off-by: Jason Dillaman --- diff --git a/src/tools/rbd_mirror/InstanceWatcher.cc b/src/tools/rbd_mirror/InstanceWatcher.cc index 7347816cf6eb..9ba9d01056a9 100644 --- a/src/tools/rbd_mirror/InstanceWatcher.cc +++ b/src/tools/rbd_mirror/InstanceWatcher.cc @@ -404,17 +404,12 @@ void InstanceWatcher::notify_image_acquire( ceph_assert(m_on_finish == nullptr); - if (instance_id == m_instance_id) { - handle_image_acquire(global_image_id, on_notify_ack); - } else { - uint64_t request_id = ++m_request_seq; - bufferlist bl; - encode(NotifyMessage{ImageAcquirePayload{request_id, global_image_id}}, - bl); - auto req = new C_NotifyInstanceRequest(this, instance_id, request_id, - std::move(bl), on_notify_ack); - req->send(); - } + uint64_t request_id = ++m_request_seq; + bufferlist bl; + encode(NotifyMessage{ImageAcquirePayload{request_id, global_image_id}}, bl); + auto req = new C_NotifyInstanceRequest(this, instance_id, request_id, + std::move(bl), on_notify_ack); + req->send(); } template @@ -428,17 +423,12 @@ void InstanceWatcher::notify_image_release( ceph_assert(m_on_finish == nullptr); - if (instance_id == m_instance_id) { - handle_image_release(global_image_id, on_notify_ack); - } else { - uint64_t request_id = ++m_request_seq; - bufferlist bl; - encode(NotifyMessage{ImageReleasePayload{request_id, global_image_id}}, - bl); - auto req = new C_NotifyInstanceRequest(this, instance_id, request_id, - std::move(bl), on_notify_ack); - req->send(); - } + uint64_t request_id = ++m_request_seq; + bufferlist bl; + encode(NotifyMessage{ImageReleasePayload{request_id, global_image_id}}, bl); + auto req = new C_NotifyInstanceRequest(this, instance_id, request_id, + std::move(bl), on_notify_ack); + req->send(); } template @@ -452,17 +442,13 @@ void InstanceWatcher::notify_peer_image_removed( Mutex::Locker locker(m_lock); ceph_assert(m_on_finish == nullptr); - if (instance_id == m_instance_id) { - handle_peer_image_removed(global_image_id, peer_mirror_uuid, on_notify_ack); - } else { - uint64_t request_id = ++m_request_seq; - bufferlist bl; - encode(NotifyMessage{PeerImageRemovedPayload{request_id, global_image_id, - peer_mirror_uuid}}, bl); - auto req = new C_NotifyInstanceRequest(this, instance_id, request_id, - std::move(bl), on_notify_ack); - req->send(); - } + uint64_t request_id = ++m_request_seq; + bufferlist bl; + encode(NotifyMessage{PeerImageRemovedPayload{request_id, global_image_id, + peer_mirror_uuid}}, bl); + auto req = new C_NotifyInstanceRequest(this, instance_id, request_id, + std::move(bl), on_notify_ack); + req->send(); } template