From a2583c50e7e5ec9da01b545cd76128f552b78209 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 17 Dec 2015 17:19:06 -0800 Subject: [PATCH] rgw: meta sync, handle ENOENT, ECANCELED retry when canceled, continue when entry does not exist. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_sync.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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; -- 2.47.3