]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: fix syncs_from in 'bucket sync status' 29270/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 24 May 2019 20:59:34 +0000 (16:59 -0400)
committerNathan Cutler <ncutler@suse.com>
Wed, 24 Jul 2019 14:01:47 +0000 (16:01 +0200)
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>
(cherry picked from commit 9da888686c3a8880976cd604bdafc4361068c985)

Conflicts:
src/rgw/rgw_zone.h
- in mimic, this code is in src/rgw/rgw_rados.h - made the change there instead

src/rgw/rgw_admin.cc
src/rgw/rgw_rados.h

index dec7c3a785c3e109852a76d9fd79645e2c5c97eb..45e32b221345161c1b1882260910373f23702f6d 100644 (file)
@@ -2363,7 +2363,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 fe4e8e708724ef3d376e7293ce6579e7198f350e..e6cc5809f84ab1f9f4d853de65fbbdd12a5c962b 100644 (file)
@@ -1415,8 +1415,8 @@ struct RGWZone {
 
   bool is_read_only() { return read_only; }
 
-  bool syncs_from(const string& zone_id) const {
-    return (sync_from_all || sync_from.find(zone_id) != sync_from.end());
+  bool syncs_from(const string& zone_name) const {
+    return (sync_from_all || sync_from.find(zone_name) != sync_from.end());
   }
 };
 WRITE_CLASS_ENCODER(RGWZone)