From: Yehuda Sadeh Date: Tue, 9 Feb 2016 17:54:37 +0000 (-0800) Subject: rgw: more error handling X-Git-Tag: v10.1.0~354^2~40 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9abb8e621ec7deed73aa85f388677997179ceaf1;p=ceph.git rgw: more error handling Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 021b873ec1e..3042560cf82 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -3,6 +3,7 @@ #include "common/RefCountedObj.h" #include "common/WorkQueue.h" #include "common/Throttle.h" +#include "common/errno.h" #include "rgw_common.h" #include "rgw_rados.h" @@ -679,6 +680,10 @@ public: } while (marker_tracker->need_retry(raw_key)); sync_status = retcode; + + if (sync_status < 0) { + yield call(sync_env->error_logger->log_error_cr("data", bucket_name + ":" + bucket_instance, -sync_status, string("failed to sync bucket instance: ") + cpp_strerror(-sync_status))); + } #warning what do do in case of error if (!entry_marker.empty()) { /* update marker */ @@ -688,7 +693,7 @@ public: sync_status = retcode; } if (sync_status < 0) { - return set_cr_error(retcode); + return set_cr_error(sync_status); } return set_cr_done(); } diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index a3f41bbaba5..9c475abe66b 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -4,6 +4,7 @@ #include "common/WorkQueue.h" #include "common/Throttle.h" #include "common/admin_socket.h" +#include "common/errno.h" #include "rgw_common.h" #include "rgw_rados.h" @@ -1077,9 +1078,9 @@ int RGWMetaSyncSingleEntryCR::operate() { } if (sync_status < 0) { -#warning need to store entry for non-transient errors ldout(sync_env->cct, 10) << *this << ": failed to send read remote metadata entry: section=" << section << " key=" << key << " status=" << sync_status << dendl; log_error() << "failed to send read remote metadata entry: section=" << section << " key=" << key << " status=" << sync_status << std::endl; + yield call(sync_env->error_logger->log_error_cr(section, key, -sync_status, string("failed to read remote metadata entry: ") + cpp_strerror(-sync_status))); return set_cr_error(sync_status); }