]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: no need to perform extra image-meta filtering for image-state 33490/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 25 Feb 2020 14:31:13 +0000 (09:31 -0500)
committerJason Dillaman <dillaman@redhat.com>
Thu, 27 Feb 2020 13:22:58 +0000 (08:22 -0500)
The image-state now only stores non RBD-internal image-meta keys and only
non RBD-internal image-meta keys are returned from the image-meta helper
state machine.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/tools/rbd_mirror/image_replayer/snapshot/ApplyImageStateRequest.cc

index b0a0a2c3b3ed4f783265e0faf57be29171b072a8..2ed3217388f6d0edbc95db4c3c39fe238b46ae5f 100644 (file)
@@ -9,7 +9,6 @@
 #include "librbd/Operations.h"
 #include "librbd/Utils.h"
 #include "librbd/image/GetMetadataRequest.h"
-#include "librbd/mirror/snapshot/Utils.h"
 #include "tools/rbd_mirror/image_replayer/snapshot/Utils.h"
 #include <boost/algorithm/string/predicate.hpp>
 
@@ -169,12 +168,8 @@ void ApplyImageStateRequest<I>::handle_get_image_meta(int r) {
 
 template <typename I>
 void ApplyImageStateRequest<I>::update_image_meta() {
-  auto key_filter = librbd::mirror::snapshot::util::get_image_meta_key("");
   std::set<std::string> keys_to_remove;
   for (const auto& [key, value] : m_metadata) {
-    if (boost::starts_with(key, key_filter)) {
-      continue;
-    }
     if (m_image_state.metadata.count(key) == 0) {
       dout(15) << "removing image-meta key '" << key << "'" << dendl;
       keys_to_remove.insert(key);
@@ -183,10 +178,6 @@ void ApplyImageStateRequest<I>::update_image_meta() {
 
   std::map<std::string, bufferlist> metadata_to_update;
   for (const auto& [key, value] : m_image_state.metadata) {
-    if (boost::starts_with(key, key_filter)) {
-      continue;
-    }
-
     auto it = m_metadata.find(key);
     if (it == m_metadata.end() || !it->second.contents_equal(value)) {
       dout(15) << "updating image-meta key '" << key << "'" << dendl;