diff --git a/src/rgw/driver/rados/rgw_zone.cc b/src/rgw/driver/rados/rgw_zone.cc index 11b57e42720..e6cc54d69d8 100644 --- a/src/rgw/driver/rados/rgw_zone.cc +++ b/src/rgw/driver/rados/rgw_zone.cc @@ -1035,10 +1035,12 @@ int create_zone(const DoutPrefixProvider* dpp, optional_yield y, } // add default placement with empty pool name + RGWZonePlacementInfo placement; rgw_pool pool; - auto& placement = info.placement_pools["default-placement"]; placement.storage_classes.set_storage_class( RGW_STORAGE_CLASS_STANDARD, &pool, nullptr); + // don't overwrite if it already exists + info.placement_pools.emplace("default-placement", std::move(placement)); // build a set of all pool names used by other zones std::set pools;