]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: fix syncs_from in 'bucket sync status' 28243/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 24 May 2019 20:59:34 +0000 (16:59 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 24 May 2019 21:01:13 +0000 (17:01 -0400)
If a zone is set up with sync_from_all=false, the bucket sync status
command will incorrectly report "not in sync_from" because it's calling
'zone.syncs_from(source.id)', where syncs_from() expects a zone name
instead of id

Fixes: http://tracker.ceph.com/issues/40022
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_admin.cc
src/rgw/rgw_zone.h

index 51c74621bbec47d8166b28323b758207fd71c7f7..64d7f9d93d7352d3b4ad7b2c5d72d6b06254bed9 100644 (file)
@@ -2413,7 +2413,7 @@ static int bucket_source_sync_status(RGWRados *store, const RGWZone& zone,
   out << indented{width, "source zone"} << source.id << " (" << source.name << ")\n";
 
   // syncing from this zone?
-  if (!zone.syncs_from(source.id)) {
+  if (!zone.syncs_from(source.name)) {
     out << indented{width} << "not in sync_from\n";
     return 0;
   }
index 19603d6caf1910a2f13d3e0ccad26930b24c1574..14bd53b2e6eb5a502d5ea18a6422255384b6d326 100644 (file)
@@ -613,8 +613,8 @@ struct RGWZone {
 
   bool is_read_only() const { return read_only; }
 
-  bool syncs_from(const std::string& zone_id) const {
-    return (sync_from_all || sync_from.find(zone_id) != sync_from.end());
+  bool syncs_from(const std::string& zone_name) const {
+    return (sync_from_all || sync_from.find(zone_name) != sync_from.end());
   }
 };
 WRITE_CLASS_ENCODER(RGWZone)