From b6b30cada3e9ec390e76f53986e2677b8f1d947a Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 27 Jan 2020 17:30:50 -0800 Subject: [PATCH] rgw: don't include empty buckets in potential related buckets Being used by the sync hint system Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_sync_policy.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); + } } } } -- 2.39.5