]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: propagate sync pipe params down the stack
authorYehuda Sadeh <yehuda@redhat.com>
Sat, 9 Nov 2019 02:23:42 +0000 (18:23 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 28 Jan 2020 18:20:38 +0000 (10:20 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_data_sync.cc
src/rgw/rgw_data_sync.h

index 4455a48538bff0b7eccf6554686d1a303756e931..bbc4bc6717540f3ab7a01644bdf4cf09a396414c 100644 (file)
@@ -1125,6 +1125,7 @@ std::ostream& operator<<(std::ostream& out, const rgw_sync_pipe_info_entity& e)
 }
 
 struct rgw_sync_pipe_info {
+  rgw_sync_pipe_params params;
   rgw_sync_pipe_info_entity source;
   rgw_sync_pipe_info_entity target;
 
@@ -1132,7 +1133,9 @@ struct rgw_sync_pipe_info {
   rgw_sync_pipe_info(const rgw_sync_bucket_pipe& pipe,
                      std::optional<RGWBucketInfo> source_bucket_info,
                      std::optional<RGWBucketInfo> target_bucket_info) : source(pipe.source, source_bucket_info),
-                                                                        target(pipe.dest, target_bucket_info) {}
+                                                                        target(pipe.dest, target_bucket_info) {
+    params = pipe.params;
+  }
 
   bool operator<(const rgw_sync_pipe_info& p) const {
     if (source < p.source) {
@@ -3813,6 +3816,8 @@ int RGWRunBucketSourcesSyncCR::operate()
         }
         sync_pair.dest_bs.bucket = siter->target.get_bucket();
 
+        sync_pair.params = siter->params;
+
         if (sync_pair.source_bs.shard_id >= 0) {
           num_shards = 1;
           cur_shard = sync_pair.source_bs.shard_id;
@@ -3925,6 +3930,7 @@ int RGWSyncGetBucketInfoCR::operate()
 void RGWGetBucketPeersCR::update_from_target_bucket_policy()
 {
   if (!target_policy ||
+      !target_policy->policy_handler ||
       !pipes) {
     return;
   }
@@ -3949,6 +3955,7 @@ void RGWGetBucketPeersCR::update_from_target_bucket_policy()
 void RGWGetBucketPeersCR::update_from_source_bucket_policy()
 {
   if (!source_policy ||
+      !source_policy->policy_handler ||
       !pipes) {
     return;
   }
index 9d223ebb2e13ab315896f376a9d59008eb855521..273da1b8624bb81c131ba61560cc303132e2ec34 100644 (file)
 
 #include "rgw_sync_module.h"
 #include "rgw_sync_trace.h"
+#include "rgw_sync_policy.h"
 
 class JSONObj;
 struct rgw_sync_bucket_pipe;
 
 struct rgw_bucket_sync_pair_info {
+  rgw_sync_pipe_params params;
   rgw_bucket_shard source_bs;
   rgw_bucket_shard dest_bs;
-  string source_prefix;
-  string dest_prefix;
 };
 
 inline ostream& operator<<(ostream& out, const rgw_bucket_sync_pair_info& p) {
-  if (p.source_bs.bucket == p.dest_bs.bucket &&
-      p.source_prefix == p.dest_prefix) {
+  if (p.source_bs.bucket == p.dest_bs.bucket) {
     return out << p.source_bs;
   }
 
   out << p.source_bs;
 
-  if (!p.source_prefix.empty()) {
-    out << "/" << p.source_prefix;
+  if (p.params.filter.prefix) {
+    out << "/" << *p.params.filter.prefix + "*";
   }
 
   out << "->" << p.dest_bs.bucket;
 
-  if (!p.dest_prefix.empty()) {
-    out << "/" << p.dest_prefix;
-  }
-
   return out;
 }