From ba28520c421514e898c111a1baed37e3542be7eb 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 cc78ac108fcb..8f6d655638a8 100644 --- a/src/rgw/rgw_reshard.cc +++ b/src/rgw/rgw_reshard.cc @@ -475,6 +475,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, @@ -482,11 +483,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