]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_op: pass delete bucket op to master zone first 8930/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Tue, 19 Apr 2016 13:20:53 +0000 (15:20 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Wed, 4 May 2016 16:36:19 +0000 (18:36 +0200)
Basically first ask the master to process a delete bucket request before
we process it in the zone locally, otherwise we reach a situation where
we drop the bucket locally and master will still maintain an index

Fixes: http://tracker.ceph.com/issues/15540
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit da6b44a6e47399493adae53ad3c36a029f1e2a23)

src/rgw/rgw_op.cc

index d0508213069b752e09bcab0388cf2b97b071a566..a2202caf07518f9733e9ca8c816c81ca6ad01c1b 100644 (file)
@@ -2113,6 +2113,20 @@ void RGWDeleteBucket::execute()
      ldout(s->cct, 1) << "WARNING: failed to sync user stats before bucket delete: op_ret= " << op_ret << dendl;
   }
 
+  if (!store->is_meta_master()) {
+    bufferlist in_data;
+    op_ret = forward_request_to_master(s, &ot.read_version, store, in_data,
+                                      NULL);
+    if (op_ret < 0) {
+      if (op_ret == -ENOENT) {
+        /* adjust error, we want to return with NoSuchBucket and not
+        * NoSuchKey */
+        op_ret = -ERR_NO_SUCH_BUCKET;
+      }
+      return;
+    }
+  }
+
   op_ret = store->delete_bucket(s->bucket, ot);
   if (op_ret == 0) {
     op_ret = rgw_unlink_bucket(store, s->user->user_id, s->bucket.tenant,
@@ -2127,19 +2141,6 @@ void RGWDeleteBucket::execute()
     return;
   }
 
-  if (!store->is_meta_master()) {
-    bufferlist in_data;
-    op_ret = forward_request_to_master(s, &ot.read_version, store, in_data,
-                                      NULL);
-    if (op_ret < 0) {
-      if (op_ret == -ENOENT) {
-        /* adjust error, we want to return with NoSuchBucket and not
-        * NoSuchKey */
-        op_ret = -ERR_NO_SUCH_BUCKET;
-      }
-      return;
-    }
-  }
 
 }