]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't fail if lost race when setting acls 11471/head
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 30 Sep 2016 23:13:00 +0000 (16:13 -0700)
committerLoic Dachary <ldachary@redhat.com>
Thu, 13 Oct 2016 09:41:56 +0000 (11:41 +0200)
Fixes: http://tracker.ceph.com/issues/16930
When concurrently setting acls on object/bucket, we could lose in a race.
Instead of retry, just return success (same effect as if we won and then
other writer overwrote us).

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 6e9a915b565923081f609048072b8d75716a74ea)

src/rgw/rgw_op.cc

index b4a09d7fcda6f08f08afd1c9cf7810ffcc4c3214..8f22c82a773ab8aad6a41d7ad613c811a13ed4db 100644 (file)
@@ -3558,6 +3558,9 @@ void RGWPutACLs::execute()
     attrs[RGW_ATTR_ACL] = bl;
     op_ret = rgw_bucket_set_attrs(store, s->bucket_info, attrs, &s->bucket_info.objv_tracker);
   }
+  if (op_ret == -ECANCELED) {
+    op_ret = 0; /* lost a race, but it's ok because acls are immutable */
+  }
 }
 
 int RGWGetCORS::verify_permission()