From bc0a5ff95247b41b5a8336a8c4ed83c4315c1966 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Fri, 12 Oct 2018 10:24:32 -0400 Subject: [PATCH] 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 --- src/rgw/rgw_reshard.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; -- 2.39.5