]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/multisite: metadata sync only retries on errors 44078/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 23 Nov 2021 20:44:03 +0000 (15:44 -0500)
committerCasey Bodley <cbodley@redhat.com>
Thu, 13 Jan 2022 16:20:12 +0000 (11:20 -0500)
in 866d66b8749b28ec626a8d0adba3d14fdd8abead, metadata sync was fixed to
retry on error codes other than EAGAIN/ECANCELED. but this change caused
us to retry on success as well, which means we send 10 GET requests for
each piece of metadata, and write it to rados 10 times

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_sync.cc

index 80b710d404a7c2cec86d607956f7320ca4a0edcc..e7f27602029c767a67b886787c9b3f29c95eca15 100644 (file)
@@ -1297,14 +1297,14 @@ int RGWMetaSyncSingleEntryCR::operate(const DoutPrefixProvider *dpp) {
         break;
       }
 
-      if (tries < NUM_TRANSIENT_ERROR_RETRIES - 1) {
-        ldpp_dout(dpp, 20) << *this << ": failed to fetch remote metadata: " << section << ":" << key << ", will retry" << dendl;
-        continue;
-      }
-
       if (sync_status < 0) {
-        tn->log(10, SSTR("failed to send read remote metadata entry: section=" << section << " key=" << key << " status=" << sync_status));
-        log_error() << "failed to send read remote metadata entry: section=" << section << " key=" << key << " status=" << sync_status << std::endl;
+        if (tries < NUM_TRANSIENT_ERROR_RETRIES - 1) {
+          ldpp_dout(dpp, 20) << *this << ": failed to fetch remote metadata: " << section << ":" << key << ", will retry" << dendl;
+          continue;
+        }
+
+        tn->log(10, SSTR("failed to read remote metadata entry: section=" << section << " key=" << key << " status=" << sync_status));
+        log_error() << "failed to read remote metadata entry: section=" << section << " key=" << key << " status=" << sync_status << std::endl;
         yield call(sync_env->error_logger->log_error_cr(dpp, sync_env->conn->get_remote_id(), section, key, -sync_status,
                                                         string("failed to read remote metadata entry: ") + cpp_strerror(-sync_status)));
         return set_cr_error(sync_status);
@@ -1317,12 +1317,12 @@ int RGWMetaSyncSingleEntryCR::operate(const DoutPrefixProvider *dpp) {
     for (tries = 0; tries < NUM_TRANSIENT_ERROR_RETRIES; tries++) {
       if (sync_status != -ENOENT) {
         tn->log(10, SSTR("storing local metadata entry"));
-          yield call(new RGWMetaStoreEntryCR(sync_env, raw_key, md_bl));
+        yield call(new RGWMetaStoreEntryCR(sync_env, raw_key, md_bl));
       } else {
         tn->log(10, SSTR("removing local metadata entry"));
-          yield call(new RGWMetaRemoveEntryCR(sync_env, raw_key));
+        yield call(new RGWMetaRemoveEntryCR(sync_env, raw_key));
       }
-      if (tries < NUM_TRANSIENT_ERROR_RETRIES - 1) {
+      if ((retcode < 0) && (tries < NUM_TRANSIENT_ERROR_RETRIES - 1)) {
         ldpp_dout(dpp, 20) << *this << ": failed to store metadata: " << section << ":" << key << ", got retcode=" << retcode << dendl;
         continue;
       }