]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: more error handling
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 9 Feb 2016 17:54:37 +0000 (09:54 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 21:03:32 +0000 (13:03 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_data_sync.cc
src/rgw/rgw_sync.cc

index 021b873ec1ef61b6b04e56d384b99eb4b33a6396..3042560cf824bda51e74f923e05585055f609630 100644 (file)
@@ -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();
     }
index a3f41bbaba5fa75042374bd50fc48d792120becf..9c475abe66befd82f5e4b4ccfcf84ccb2e7e4b61 100644 (file)
@@ -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);
       }