]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: return bucket's location no matter which zonegroup it located in. 17250/head
authorlu.shasha <lu.shasha@eisoo.com>
Fri, 25 Aug 2017 07:05:52 +0000 (15:05 +0800)
committerlu.shasha <lu.shasha@eisoo.com>
Fri, 25 Aug 2017 07:15:37 +0000 (15:15 +0800)
Get bucket location which is created in another zonegroup, will return "301 Moved Permanently".

Fixes: http://tracker.ceph.com/issues/21125
Signed-off-by: Shasha Lu <lu.shasha@eisoo.com>
src/rgw/rgw_common.h
src/rgw/rgw_op.cc
src/rgw/rgw_op.h

index f0e061cb0103476c107ec96dcbd04a01f2c68480..30f5e770cdc4e34a0c70a70e3fcda0e7e72ebe2e 100644 (file)
@@ -436,6 +436,7 @@ enum RGWOpType {
   RGW_OP_STAT_ACCOUNT,
   RGW_OP_LIST_BUCKET,
   RGW_OP_GET_BUCKET_LOGGING,
+  RGW_OP_GET_BUCKET_LOCATION,
   RGW_OP_GET_BUCKET_VERSIONING,
   RGW_OP_SET_BUCKET_VERSIONING,
   RGW_OP_GET_BUCKET_WEBSITE,
index db00d2ea6276819e1faf015838927cda621a4aaa..93fe17d8269e72f9455213494bf7745680885900 100644 (file)
@@ -495,6 +495,8 @@ int rgw_build_bucket_policies(RGWRados* store, struct req_state* s)
        */
       if (store->get_zonegroup().is_master_zonegroup() && s->system_request) {
         /*If this is the master, don't redirect*/
+      } else if (s->op_type == RGW_OP_GET_BUCKET_LOCATION ) {
+        /* If op is get bucket location, don't redirect */
       } else if (!s->local_source ||
           (s->op != OP_PUT && s->op != OP_COPY) ||
           s->object.empty()) {
index d9ce2b400011ff815b3c800cad4b9364e9d04809..b8fe07d3a73c49c28db76579226f0f16a49e9397 100644 (file)
@@ -739,6 +739,7 @@ public:
 
   void send_response() override = 0;
   const string name() override { return "get_bucket_location"; }
+  RGWOpType get_type() override { return RGW_OP_GET_BUCKET_LOCATION; }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
 };