From: Yehuda Sadeh Date: Sat, 9 Nov 2019 02:23:42 +0000 (-0800) Subject: rgw: propagate sync pipe params down the stack X-Git-Tag: v15.1.0~22^2~65 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b2c9a6bb412cd1379f018f53892f1141771ce59f;p=ceph.git rgw: propagate sync pipe params down the stack Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 4455a48538bf..bbc4bc671754 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -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 source_bucket_info, std::optional 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; } diff --git a/src/rgw/rgw_data_sync.h b/src/rgw/rgw_data_sync.h index 9d223ebb2e13..273da1b8624b 100644 --- a/src/rgw/rgw_data_sync.h +++ b/src/rgw/rgw_data_sync.h @@ -15,35 +15,30 @@ #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; }