]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: return bucket's location no matter which zonegroup it located in. 17857/head
authorlu.shasha <lu.shasha@eisoo.com>
Fri, 25 Aug 2017 07:05:52 +0000 (15:05 +0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 21 Sep 2017 03:51:56 +0000 (05:51 +0200)
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>
(cherry picked from commit 71d2eca3e00de19419fb07bf9346f5863b20d40f)

src/rgw/rgw_common.h
src/rgw/rgw_op.cc
src/rgw/rgw_op.h

index 8d299cf39d475c4818491ec3c6c3fee0ef785d20..5ba3b4af57acbd46f7467b0f13909f3786437a70 100644 (file)
@@ -437,6 +437,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 ac6f7b70081aece857f51238abbd19cf778f217e..481080f44cf8296454a8aaf06202c7da4698c838 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; }
 };