]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: index metadata in elasticsearch using realm name for path 10731/head
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 29 Aug 2016 18:18:43 +0000 (11:18 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 7 Oct 2016 17:31:28 +0000 (10:31 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rados.h
src/rgw/rgw_sync_module_es.cc

index 7cb8f667db34b481fef6fd06ec1e6aafff6326b7..b2092a160ac09f2da1997f5ed4175ed597092b29 100644 (file)
@@ -2024,6 +2024,10 @@ public:
     return ret;
   }
 
+  RGWRealm& get_realm() {
+    return realm;
+  }
+
   RGWZoneParams& get_zone_params() { return zone_params; }
   RGWZoneGroup& get_zonegroup() {
     return zonegroup;
index 7e7708b22c64c120ea5a32b822506961bdf394f3..afecf7224f51d804382cc297ccd27ab80d293479 100644 (file)
@@ -14,9 +14,9 @@ struct ElasticConfig {
   RGWRESTConn *conn{nullptr};
 };
 
-static string es_get_obj_path(const RGWBucketInfo& bucket_info, const rgw_obj_key& key)
+static string es_get_obj_path(const RGWRealm& realm, const RGWBucketInfo& bucket_info, const rgw_obj_key& key)
 {
-  string path = "/rgw/object/" + bucket_info.bucket.bucket_id + ":" + key.name + ":" + key.instance;
+  string path = "/rgw-" + realm.get_name() + "/object/" + bucket_info.bucket.bucket_id + ":" + key.name + ":" + key.instance;
   return path;
 }
 
@@ -123,7 +123,7 @@ public:
                               << " b=" << bucket_info.bucket << " k=" << key << " size=" << size << " mtime=" << mtime
                               << " attrs=" << attrs << dendl;
       yield {
-        string path = es_get_obj_path(bucket_info, key);
+        string path = es_get_obj_path(sync_env->store->get_realm(), bucket_info, key);
         es_obj_metadata doc(sync_env->cct, bucket_info, key, mtime, size, attrs);
 
         call(new RGWPutRESTResourceCR<es_obj_metadata, int>(sync_env->cct, conf.conn,
@@ -175,7 +175,7 @@ public:
       ldout(sync_env->cct, 0) << ": remove remote obj: z=" << sync_env->source_zone
                               << " b=" << bucket_info.bucket << " k=" << key << " mtime=" << mtime << dendl;
       yield {
-        string path = es_get_obj_path(bucket_info, key);
+        string path = es_get_obj_path(sync_env->store->get_realm(), bucket_info, key);
 
         call(new RGWDeleteRESTResourceCR(sync_env->cct, conf.conn,
                                          sync_env->http_manager,