]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/multisite: remove metadata entry when remote fetch reply with ENOENT 47420/head
authoryuval Lifshitz <ylifshit@redhat.com>
Tue, 2 Aug 2022 09:53:23 +0000 (12:53 +0300)
committeryuval Lifshitz <ylifshit@redhat.com>
Thu, 4 Aug 2022 08:53:39 +0000 (11:53 +0300)
Signed-off-by: yuval Lifshitz <ylifshit@redhat.com>
src/rgw/rgw_sync.cc

index 815405e0a02bab8b3d21af277e67de5b4784443a..cc6f12b08caa44248ef8622beec5925e4b3adb8d 100644 (file)
@@ -1322,13 +1322,12 @@ int RGWMetaSyncSingleEntryCR::operate(const DoutPrefixProvider *dpp) {
       sync_status = retcode;
 
       if (sync_status == -ENOENT) {
-        /* FIXME: do we need to remove the entry from the local zone? */
         break;
       }
 
       if (sync_status < 0) {
         if (tries < NUM_TRANSIENT_ERROR_RETRIES - 1) {
-          ldpp_dout(dpp, 20) << *this << ": failed to fetch remote metadata: " << section << ":" << key << ", will retry" << dendl;
+          ldpp_dout(dpp, 20) << *this << ": failed to fetch remote metadata entry: " << section << ":" << key << ", will retry" << dendl;
           continue;
         }
 
@@ -1345,14 +1344,18 @@ int RGWMetaSyncSingleEntryCR::operate(const DoutPrefixProvider *dpp) {
     retcode = 0;
     for (tries = 0; tries < NUM_TRANSIENT_ERROR_RETRIES; tries++) {
       if (sync_status != -ENOENT) {
-        tn->log(10, SSTR("storing local metadata entry"));
+        tn->log(10, SSTR("storing local metadata entry: " << section << ":" << key));
         yield call(new RGWMetaStoreEntryCR(sync_env, raw_key, md_bl));
       } else {
-        tn->log(10, SSTR("removing local metadata entry"));
+        tn->log(10, SSTR("removing local metadata entry:" << section << ":" << key));
         yield call(new RGWMetaRemoveEntryCR(sync_env, raw_key));
+        if (retcode == -ENOENT) {
+          retcode = 0;
+          break;
+        }
       }
       if ((retcode < 0) && (tries < NUM_TRANSIENT_ERROR_RETRIES - 1)) {
-        ldpp_dout(dpp, 20) << *this << ": failed to store metadata: " << section << ":" << key << ", got retcode=" << retcode << dendl;
+        ldpp_dout(dpp, 20) << *this << ": failed to store metadata entry: " << section << ":" << key << ", got retcode=" << retcode << ", will retry" << dendl;
         continue;
       }
       break;