From: Casey Bodley Date: Fri, 24 May 2019 20:59:34 +0000 (-0400) Subject: radosgw-admin: fix syncs_from in 'bucket sync status' X-Git-Tag: v13.2.7~204^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F29270%2Fhead;p=ceph.git radosgw-admin: fix syncs_from in 'bucket sync status' 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 (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 --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index dec7c3a785c3..45e32b221345 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -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; } diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index fe4e8e708724..e6cc5809f84a 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -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)