From: Yehuda Sadeh Date: Fri, 18 Dec 2015 01:19:06 +0000 (-0800) Subject: rgw: meta sync, handle ENOENT, ECANCELED X-Git-Tag: v10.1.0~354^2~115 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a2583c50e7e5ec9da01b545cd76128f552b78209;p=ceph.git rgw: meta sync, handle ENOENT, ECANCELED retry when canceled, continue when entry does not exist. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index 6f2b3a0b2d7..45d4e2ea27a 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -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;