Repository navigation
python-common/rgw: fix get_realm_tokens returning empty result for realms with a secondary zone - #70214
Merged
Conversation
Contributor
Author
|
jenkins test api |
afreen23
requested changes
Jul 17, 2026
afreen23
left a comment
Contributor
There was a problem hiding this comment.
The root cause analysis is correct — secondary sites can't run zone get --zone-id=<master_zone_id> because master zone params aren't stored locally. Extracting the endpoint directly from the period map avoids that lookup entirely, which is the right approach.
Two things:
get_master_zone_name(line ~883) is no longer called byget_realms_infoand has no other callers in this file — it's dead code now. Please remove it.- No unit tests for the new
_get_master_zone_ep_from_periodor for the fallback credential path — please add at least a mock-based test for the secondary-site scenario.
aaSharma14
force-pushed
the
fix-78232-main
branch
from
July 20, 2026 09:13
412d95e to
0f06ee2
Compare
…alms with a secondary zone Issue: The Export Multi-site Realm Token feature in the Dashboard showed no token and no realm details for any realm that had a secondary zone configured (i.e. the realm had been replicated to another cluster). The API endpoint GET /api/rgw/realm/get_realm_tokens returned an empty list or raised a 500 Internal Server Error. Fixes: https://tracker.ceph.com/issues/78232 Signed-off-by: Aashish Sharma <[email protected]>
aaSharma14
force-pushed
the
fix-78232-main
branch
from
July 21, 2026 05:03
0f06ee2 to
b6b591d
Compare
Contributor
|
I missed the fact it would need reviews from RGW team as well. My bad, though it was a small issue, please review we can open a new PR with followups. Thanks |
This was referenced Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: The Export Multi-site Realm Token feature in the Dashboard showed no token and no realm details for any realm that had a secondary zone configured (i.e. the realm had been replicated to another cluster). The API endpoint GET /api/rgw/realm/get_realm_tokens returned an empty list or raised a 500 Internal Server Error.
Root cause: The bug was in [RGWAM.get_realms_info()] introduced in commit e4183b2 (tracker #67897). That commit added a guard:
local_zone_list = self.zone_op().list() # radosgw-admin zone list if master_zone_name in local_zone_list:radosgw-admin zone list returns only zones whose RGWZoneParams are stored locally in RADOS on that cluster. On a secondary site the local zone list contains only the secondary zone - the master zone belongs to the primary cluster. The guard therefore silently skipped every realm on the secondary site, producing an empty result.
Additionally, the fallback zone get --zone-id=<master_zone_id> introduced in the same commit would crash with ENOENT on the secondary site because RGWZoneParams for the master zone is not stored locally, causing the 500 error.
Fix:
Remove the local_zone_list guard entirely. The RGW period map is fully replicated to every site in the realm. All the realm/zonegroup/zone topology data (including master zone ID and endpoints) is always available locally via radosgw-admin period get.
Gracefully handle zone get --zone-id=<master_zone_id> failure on secondary sites. RGWZoneParams (which holds system_key) is a per-zone RADOS object - only the local zone's params exist on a secondary cluster. When the master zone lookup raises ENOENT, fall back to fetching any locally-present zone's params. This is correct because the secondary zone is always created with the same access_key/secret as the master system user.
Fixes: https://tracker.ceph.com/issues/78232
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.