From: Casey Bodley Date: Tue, 25 Oct 2016 17:01:59 +0000 (-0400) Subject: rgw: fix for bucket delete racing with mdlog sync X-Git-Tag: v11.1.0~386^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e9cf41f9bfd1aa7d35f945f6a3ee6bb66c135bad;p=ceph.git rgw: fix for bucket delete racing with mdlog sync Fixes: http://tracker.ceph.com/issues/17698 Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 9bd377915e881..be18f794e633d 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -2481,6 +2481,14 @@ void RGWDeleteBucket::execute() } op_ret = store->delete_bucket(s->bucket, ot); + + if (op_ret == -ECANCELED) { + // lost a race, either with mdlog sync or another delete bucket operation. + // in either case, we've already called rgw_unlink_bucket() + op_ret = 0; + return; + } + if (op_ret == 0) { op_ret = rgw_unlink_bucket(store, s->user->user_id, s->bucket.tenant, s->bucket.name, false);