From 696c2dcad775f6ba9bdcff3ba4f9be2bff7664c7 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Thu, 7 Jun 2018 11:45:31 +0200 Subject: [PATCH] rgw: warn if zone doesn't contain all zg's placement targets It is possible that a placement target that is configured in a zonegroup is not configured in a local zone. Detect this condition and print a warning message Signed-off-by: Abhishek Lekshmanan --- src/rgw/rgw_rados.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 76719661275..8a89bba5062 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -4627,6 +4627,14 @@ int RGWRados::init_complete() } if (run_sync_thread) { + + for (const auto &pt: get_zonegroup().placement_targets) { + if (get_zone_params().placement_pools.find(pt.second.name) + == get_zone_params().placement_pools.end()){ + ldout(cct, 0) << "WARNING: This zone does not contain the placement target " + << pt.second.name << " present in zonegroup" << dendl; + } + } Mutex::Locker l(meta_sync_thread_lock); meta_sync_processor_thread = new RGWMetaSyncProcessorThread(this, async_rados); ret = meta_sync_processor_thread->init(); @@ -6204,6 +6212,8 @@ int RGWRados::select_bucket_location_by_rule(const string& location_rule, RGWZon if (get_zonegroup().equals(zonegroup.get_id())) { /* that's a configuration error, zone should have that rule, as we're within the requested * zonegroup */ + ldout(cct, 0) << "ERROR: This zone does not contain placement rule" + << location_rule << " present in the zonegroup!" << dendl; return -EINVAL; } else { /* oh, well, data is not going to be placed here, bucket object is just a placeholder */ -- 2.47.3