From: Yehuda Sadeh Date: Tue, 28 Jan 2020 01:30:50 +0000 (-0800) Subject: rgw: don't include empty buckets in potential related buckets X-Git-Tag: v15.1.0~22^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b6b30cada3e9ec390e76f53986e2677b8f1d947a;p=ceph-ci.git rgw: don't include empty buckets in potential related buckets Being used by the sync hint system Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_sync_policy.cc b/src/rgw/rgw_sync_policy.cc index a026d491cf3..6b5ecf414e0 100644 --- a/src/rgw/rgw_sync_policy.cc +++ b/src/rgw/rgw_sync_policy.cc @@ -338,7 +338,9 @@ void rgw_sync_bucket_pipes::get_potential_related_buckets(const rgw_bucket& buck auto expanded_sources = source.expand(); for (auto& s : expanded_sources) { - sources->insert(*s.bucket); + if (s.bucket && !s.bucket->name.empty()) { + sources->insert(*s.bucket); + } } } @@ -346,7 +348,9 @@ void rgw_sync_bucket_pipes::get_potential_related_buckets(const rgw_bucket& buck auto expanded_dests = dest.expand(); for (auto& d : expanded_dests) { - dests->insert(*d.bucket); + if (d.bucket && !d.bucket->name.empty()) { + dests->insert(*d.bucket); + } } } }