]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: don't include empty buckets in potential related buckets
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 28 Jan 2020 01:30:50 +0000 (17:30 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 28 Jan 2020 18:20:40 +0000 (10:20 -0800)
Being used by the sync hint system

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_sync_policy.cc

index a026d491cf30025e2cc19ea500ae795a941afebb..6b5ecf414e0f9246fe052b7d6ed0b90f8ce067b5 100644 (file)
@@ -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);
+      }
     }
   }
 }