]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: fix syncs_from in 'bucket sync status' 28739/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 24 May 2019 20:59:34 +0000 (16:59 -0400)
committerNathan Cutler <ncutler@suse.com>
Tue, 25 Jun 2019 11:05:08 +0000 (13:05 +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)

src/rgw/rgw_admin.cc
src/rgw/rgw_zone.h

index a8cc4dfef9231e3c0d889947eae09375616de120..ab74c0affacb95116fc7ee4fba7e673ed876ab80 100644 (file)
@@ -2398,7 +2398,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 6f1bd64378a87cd121133c6006e2652eac585c83..f0c8b7c60c16cc567d1b20b04fb2c0172ff02075 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)