]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't fail if lost race when setting acls 11286/head
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 30 Sep 2016 23:13:00 +0000 (16:13 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 30 Sep 2016 23:13:00 +0000 (16:13 -0700)
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>
src/rgw/rgw_op.cc

index 4c913bc9cc2251dce83ee24ef8b0c9f4cb8b7e95..7ff4a832422b8296233c3ccf7543adc558b893f5 100644 (file)
@@ -3905,6 +3905,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 */
+  }
 }
 
 static void get_lc_oid(struct req_state *s, string& oid)