]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: warn if zone doesn't contain all zg's placement targets 22452/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 7 Jun 2018 09:45:31 +0000 (11:45 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Thu, 7 Jun 2018 09:45:31 +0000 (11:45 +0200)
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 <abhishek@suse.com>
src/rgw/rgw_rados.cc

index 767196612753a760ac5cc24446a33124c25b305e..8a89bba5062cf3e2bd3cf875694dc34536fd2589 100644 (file)
@@ -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 */