From de44e649d6c56d8a32870295c7ab23f9ca399b21 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Wed, 14 Apr 2021 13:55:22 -0400 Subject: [PATCH] rgw: during reshard lock contention, adjust logging When RGW fails to get a lock on a reshard log, we log it in such a way that it looks like an error. Instead we'll make sure that the log message is informational. Signed-off-by: J. Eric Ivancich (cherry picked from commit 6d3dee37791ad427a3435c493a1d7874ba075674) --- src/rgw/rgw_reshard.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_reshard.cc b/src/rgw/rgw_reshard.cc index e55b0d1f5a68..b5733b240f32 100644 --- a/src/rgw/rgw_reshard.cc +++ b/src/rgw/rgw_reshard.cc @@ -462,6 +462,7 @@ RGWBucketReshardLock::RGWBucketReshardLock(rgw::sal::RGWRadosStore* _store, int RGWBucketReshardLock::lock() { internal_lock.set_must_renew(false); + int ret; if (ephemeral) { ret = internal_lock.lock_exclusive_ephemeral(&store->getRados()->reshard_pool_ctx, @@ -469,11 +470,19 @@ int RGWBucketReshardLock::lock() { } else { ret = internal_lock.lock_exclusive(&store->getRados()->reshard_pool_ctx, lock_oid); } - if (ret < 0) { - ldout(store->ctx(), 0) << "RGWReshardLock::" << __func__ << - " failed to acquire lock on " << lock_oid << " ret=" << ret << dendl; + + if (ret == -EBUSY) { + ldout(store->ctx(), 0) << "INFO: RGWReshardLock::" << __func__ << + " found lock on " << lock_oid << + " to be held by another RGW process; skipping for now" << dendl; + return ret; + } else if (ret < 0) { + lderr(store->ctx()) << "ERROR: RGWReshardLock::" << __func__ << + " failed to acquire lock on " << lock_oid << ": " << + cpp_strerror(-ret) << dendl; return ret; } + reset_time(Clock::now()); return 0; -- 2.47.3