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: v19.2.0~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=73e7304fb6e8b3a0a3df3d9383d29f9616509251;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 (cherry picked from commit 902cc0a71e91faf6d6e3685c036d346251e4f77f) (cherry picked from commit 358a197370b8ce527e28800246003d3e6c00027d) --- diff --git a/src/rgw/driver/rados/rgw_zone.cc b/src/rgw/driver/rados/rgw_zone.cc index 40f9c451c08..ace9d70fedd 100644 --- a/src/rgw/driver/rados/rgw_zone.cc +++ b/src/rgw/driver/rados/rgw_zone.cc @@ -1205,6 +1205,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);