]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: meta sync, handle ENOENT, ECANCELED
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 18 Dec 2015 01:19:06 +0000 (17:19 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:46 +0000 (16:13 -0800)
retry when canceled, continue when entry does not exist.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_sync.cc

index 6f2b3a0b2d72eb46d699a092fd1fb56659277f96..45d4e2ea27ab6b1ffd03395ac0d5cbaafbbe2ab2 100644 (file)
@@ -935,10 +935,10 @@ int RGWMetaSyncSingleEntryCR::operate() {
 
       if (sync_status == -ENOENT) {
 #warning remove entry from local
-        return set_cr_done();
+        break;
       }
 
-      if (sync_status == -EAGAIN && (tries < NUM_TRANSIENT_ERROR_RETRIES - 1)) {
+      if ((sync_status == -EAGAIN || sync_status == -ECANCELED) && (tries < NUM_TRANSIENT_ERROR_RETRIES - 1)) {
         ldout(sync_env->cct, 20) << *this << ": failed to fetch remote metadata: " << section << ":" << key << ", will retry" << dendl;
         continue;
       }
@@ -953,7 +953,17 @@ int RGWMetaSyncSingleEntryCR::operate() {
       break;
     }
 
-    yield call(new RGWMetaStoreEntryCR(sync_env, raw_key, md_bl));
+    retcode = 0;
+    if (sync_status != -ENOENT) {
+      for (tries = 0; tries < NUM_TRANSIENT_ERROR_RETRIES; tries++) {
+        yield call(new RGWMetaStoreEntryCR(sync_env, raw_key, md_bl));
+        if ((retcode == -EAGAIN || retcode == -ECANCELED) && (tries < NUM_TRANSIENT_ERROR_RETRIES - 1)) {
+          ldout(sync_env->cct, 20) << *this << ": failed to store metadata: " << section << ":" << key << ", got retcode=" << retcode << dendl;
+          continue;
+        }
+        break;
+      }
+    }
 
     sync_status = retcode;