From: J. Eric Ivancich Date: Fri, 12 Oct 2018 14:24:32 +0000 (-0400) Subject: rgw: change the bucket reshard lock to exclusive-ephemeral X-Git-Tag: v13.2.3~42^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2334227239e60c4deba80b50b6638e09b6b477a8;p=ceph.git rgw: change the bucket reshard lock to exclusive-ephemeral The bucket reshard lock was simply an exclusive lock that existed on an object solely for the purpose of representing the lock. This is now changed to exclusvie-ephemeral lock, so as not to leave these objects behind. Signed-off-by: J. Eric Ivancich (cherry picked from commit bc0a5ff95247b41b5a8336a8c4ed83c4315c1966) --- diff --git a/src/rgw/rgw_reshard.cc b/src/rgw/rgw_reshard.cc index 3b563cd5138..fab5522595f 100644 --- a/src/rgw/rgw_reshard.cc +++ b/src/rgw/rgw_reshard.cc @@ -226,9 +226,11 @@ RGWBucketReshard::RGWBucketReshard(RGWRados *_store, int RGWBucketReshard::lock_bucket() { reshard_lock.set_must_renew(false); - int ret = reshard_lock.lock_exclusive(&store->reshard_pool_ctx, reshard_oid); + int ret = reshard_lock.lock_exclusive_ephemeral(&store->reshard_pool_ctx, + reshard_oid); if (ret < 0) { - ldout(store->ctx(), 0) << "RGWReshard::add failed to acquire lock on " << reshard_oid << " ret=" << ret << dendl; + ldout(store->ctx(), 0) << "RGWReshard::add failed to acquire lock on " << + reshard_oid << " ret=" << ret << dendl; return ret; } lock_start_time = Clock::now(); @@ -257,7 +259,8 @@ int RGWBucketReshard::renew_lock_bucket(const Clock::time_point& now) } reshard_lock.set_must_renew(true); - int ret = reshard_lock.lock_exclusive(&store->reshard_pool_ctx, reshard_oid); + int ret = reshard_lock.lock_exclusive_ephemeral(&store->reshard_pool_ctx, + reshard_oid); if (ret < 0) { /* expired or already locked by another processor */ ldout(store->ctx(), 5) << __func__ << "(): failed to renew lock on " << reshard_oid << " with " << cpp_strerror(-ret) << dendl;