From: Casey Bodley Date: Fri, 23 Aug 2024 19:03:31 +0000 (-0400) Subject: rgw: ignore zoneless default realm when not configured X-Git-Tag: v20.0.0~1206^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=902cc0a71e91faf6d6e3685c036d346251e4f77f;p=ceph.git rgw: ignore zoneless default realm when not configured "default" zone/zonegroup deployments without a realm can be broken by the creation of an unrelated realm, because that realm is (was) automatically set as the default when startup detects an incomplete default realm (one that doesn't have a default zone), fall back to the realmless "default" zone/zonegroup instead Fixes: https://tracker.ceph.com/issues/67697 Signed-off-by: Casey Bodley --- diff --git a/src/rgw/driver/rados/rgw_zone.cc b/src/rgw/driver/rados/rgw_zone.cc index ae7a4d48e5e..f9de570aa54 100644 --- a/src/rgw/driver/rados/rgw_zone.cc +++ b/src/rgw/driver/rados/rgw_zone.cc @@ -1199,6 +1199,18 @@ int SiteConfig::load(const DoutPrefixProvider* dpp, optional_yield y, } else if (realm) { // load the realm's default zone r = cfgstore->read_default_zone(dpp, y, realm->id, zone_params, nullptr); + if (r == -ENOENT) { + if (realm_name.empty()) { + // rgw_realm was not specified, and we found a default realm that + // doesn't have a default zone. ignore the realm and try to load the + // global default zone + realm = std::nullopt; + r = read_or_create_default_zone(dpp, y, cfgstore, zone_params); + } else { + ldpp_dout(dpp, 0) << "No rgw_zone configured, and the selected realm \"" + << realm->name << "\" does not have a default zone." << dendl; + } + } } else { // load or create the "default" zone r = read_or_create_default_zone(dpp, y, cfgstore, zone_params);