]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Handle stale bucket info in RGWDeleteBucketWebsite
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 17 Nov 2017 21:05:06 +0000 (16:05 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 27 Nov 2017 20:57:15 +0000 (15:57 -0500)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_op.cc

index 325f3556fa0c0da48119a1bba97ce738b2db2a26..770c6609e648f93292ed2b2cc2f2f8153c28aab7 100644 (file)
@@ -2179,10 +2179,13 @@ void RGWDeleteBucketWebsite::pre_exec()
 
 void RGWDeleteBucketWebsite::execute()
 {
-  s->bucket_info.has_website = false;
-  s->bucket_info.website_conf = RGWBucketWebsiteConf();
-
-  op_ret = store->put_bucket_instance_info(s->bucket_info, false, real_time(), &s->bucket_attrs);
+  op_ret = retry_raced_bucket_write(store, s, [this] {
+      s->bucket_info.has_website = false;
+      s->bucket_info.website_conf = RGWBucketWebsiteConf();
+      op_ret = store->put_bucket_instance_info(s->bucket_info, false,
+                                              real_time(), &s->bucket_attrs);
+      return op_ret;
+    });
   if (op_ret < 0) {
     ldout(s->cct, 0) << "NOTICE: put_bucket_info on bucket=" << s->bucket.name << " returned err=" << op_ret << dendl;
     return;