]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: during reshard lock contention, adjust logging 42641/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Wed, 14 Apr 2021 17:55:22 +0000 (13:55 -0400)
committerCory Snyder <csnyder@iland.com>
Wed, 4 Aug 2021 14:45:57 +0000 (10:45 -0400)
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 <ivancich@redhat.com>
(cherry picked from commit 6d3dee37791ad427a3435c493a1d7874ba075674)

src/rgw/rgw_reshard.cc

index cc78ac108fcb8fb2dd2186da5706f11f63e3e3f8..8f6d655638a84a4c830b5f691e87cb6892893344 100644 (file)
@@ -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;