]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/multisite: change HTTP error handling from EIO to ERR_INTERNAL_ERROR
authorMark Kogan <mkogan@ibm.com>
Thu, 15 May 2025 13:56:02 +0000 (13:56 +0000)
committerMark Kogan <mkogan@ibm.com>
Thu, 15 May 2025 14:41:15 +0000 (14:41 +0000)
Fixes: http://tracker.ceph.com/issues/71337
Signed-off-by: Mark Kogan <mkogan@ibm.com>
src/rgw/driver/rados/rgw_data_sync.cc
src/rgw/driver/rados/rgw_rados.cc
src/rgw/driver/rados/rgw_sync.cc
src/rgw/rgw_coroutine.cc
src/rgw/rgw_rest_conn.h

index e195f18df07cd187724796a73c672c9744f1cf44..8102f4b5e2aedfa4927319be8c3ea03ab04a3469 100644 (file)
@@ -286,7 +286,7 @@ public:
         }
 
         if (op_ret < 0) {
-          if (op_ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
+          if (op_ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
             ldpp_dout(dpp, 20) << "failed to fetch remote datalog shard info. retry. shard_id=" << shard_id << dendl;
             continue;
           } else {
@@ -389,7 +389,7 @@ public:
         }
 
         if (op_ret < 0) {
-          if (op_ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
+          if (op_ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
             ldpp_dout(dpp, 20) << "failed to read remote datalog shard. retry. shard_id=" << shard_id << dendl;
             continue;
           } else {
index c8d7d1092df08c49ee8fce44a21794ca48b16226..65568a28061633f818caf03aa7915c13298f4560 100644 (file)
@@ -4256,7 +4256,7 @@ int RGWRados::stat_remote_obj(const DoutPrefixProvider *dpp,
     ret = conn->complete_request(dpp, in_stream_req, nullptr, &set_mtime, psize,
                                  nullptr, pheaders, y);
     if (ret < 0) {
-      if (ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
+      if (ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
         ldpp_dout(dpp, 20) << __func__  << "(): failed to fetch object from remote. retries=" << tries << dendl;
         continue;
       }
@@ -4523,7 +4523,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& dest_obj_ctx,
     ret = conn->complete_request(rctx.dpp, in_stream_req, &etag, &set_mtime,
                                  &accounted_size, nullptr, nullptr, rctx.y);
     if (ret < 0) {
-      if (ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
+      if (ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
         ldpp_dout(rctx.dpp, 20) << __func__ << "(): failed to fetch " << fetched_obj
                                 << " from remote. retries=" << tries << dendl;
         continue;
@@ -4802,7 +4802,7 @@ int RGWRados::copy_obj_to_remote_dest(const DoutPrefixProvider *dpp,
 
     ret = rest_master_conn->complete_request(dpp, out_stream_req, etag, mtime, y);
     if (ret < 0) {
-      if (ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
+      if (ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
         ldpp_dout(dpp, 20) << __func__  << "(): failed to put_obj_async_init. retries=" << tries << dendl;
         continue;
       }
index 0472bea986e8524a9144393913a9e2251d082f05..70c8474de9f1e8e173cdc64abfd98cc00210cac0 100644 (file)
@@ -510,7 +510,7 @@ public:
         }
 
         if (op_ret < 0) {
-          if (op_ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
+          if (op_ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
             ldpp_dout(dpp, 20) << "failed to read remote metadata log shard info. retry. shard_id=" << shard_id << dendl;
             continue;
           } else {
@@ -1094,7 +1094,7 @@ public:
         }
 
         if (op_ret < 0) {
-          if (op_ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
+          if (op_ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
             ldpp_dout(dpp, 20) << "failed to read remote metadata. retry. section=" << section << " key=" << key << dendl;
             continue;
           } else {
@@ -2440,7 +2440,7 @@ int RGWCloneMetaLogCoroutine::operate(const DoutPrefixProvider *dpp)
           return state_receive_rest_response();
         }
 
-        if (op_ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
+        if (op_ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
           ldout(cct, 20) << __func__ << ": request IO error. retries=" << tries << dendl;
           continue;
         } else if (op_ret < 0) {
@@ -2547,7 +2547,7 @@ int RGWCloneMetaLogCoroutine::state_send_rest_request(const DoutPrefixProvider *
 int RGWCloneMetaLogCoroutine::state_receive_rest_response()
 {
   op_ret = http_op->wait(sync_env->dpp, &data, null_yield);
-  if (op_ret < 0 && op_ret != -EIO) {
+  if (op_ret < 0 && op_ret != -ERR_INTERNAL_ERROR) {
     error_stream << "http operation failed: " << http_op->to_str() << " status=" << http_op->get_http_status() << std::endl;
     ldpp_dout(sync_env->dpp, 5) << "failed to wait for op, ret=" << op_ret << dendl;
     http_op->put();
@@ -2557,7 +2557,7 @@ int RGWCloneMetaLogCoroutine::state_receive_rest_response()
   http_op->put();
   http_op = NULL;
 
-  if (op_ret == -EIO) {
+  if (op_ret == -ERR_INTERNAL_ERROR) {
     return 0;
   }
 
index 3fbc9b601b005ba4e470ca1196b6e7f430956215..e8baab7eb4f2f7b6d0a61b15644d0c0d6ceb6051 100644 (file)
@@ -1088,7 +1088,7 @@ int RGWSimpleCoroutine::operate(const DoutPrefixProvider *dpp)
       yield return state_send_request(dpp);
       yield return state_request_complete();
 
-      if (op_ret == -EIO && tries < max_eio_retries - 1) {
+      if (op_ret == -ERR_INTERNAL_ERROR && tries < max_eio_retries - 1) {
         ldout(cct, 20) << "request IO error. retries=" << tries << dendl;
         continue;
       } else if (op_ret < 0) {
@@ -1129,7 +1129,7 @@ int RGWSimpleCoroutine::state_send_request(const DoutPrefixProvider *dpp)
 int RGWSimpleCoroutine::state_request_complete()
 {
   op_ret = request_complete();
-  if (op_ret < 0 && op_ret != -EIO) {
+  if (op_ret < 0 && op_ret != -ERR_INTERNAL_ERROR) {
     call_cleanup();
     return set_state(RGWCoroutine_Error, op_ret);
   }
index 1a4fa98a879c3f0bcc3ce68500a5c515bf64d383..4563750d8249d4b98ff7699192b6fdd13132cacc 100644 (file)
@@ -357,7 +357,7 @@ public:
   int wait(const DoutPrefixProvider* dpp, bufferlist *pbl, optional_yield y) {
     int ret = req.wait(dpp, y);
     if (ret < 0) {
-      if (ret == -EIO) {
+      if (ret == -ERR_INTERNAL_ERROR) {
         conn->set_url_unconnectable(req.get_url_orig());
       }
       return ret;
@@ -413,7 +413,7 @@ int RGWRESTReadResource::wait(const DoutPrefixProvider* dpp, T *dest,
 {
   int ret = req.wait(dpp, y);
   if (ret < 0) {
-    if (ret == -EIO) {
+    if (ret == -ERR_INTERNAL_ERROR) {
       conn->set_url_unconnectable(req.get_url_orig());
     }
     return ret;
@@ -488,7 +488,7 @@ public:
     int ret = req.wait(dpp, y);
     *pbl = bl;
 
-    if (ret == -EIO) {
+    if (ret == -ERR_INTERNAL_ERROR) {
       conn->set_url_unconnectable(req.get_url_orig());
     }
 
@@ -509,7 +509,7 @@ int RGWRESTSendResource::wait(const DoutPrefixProvider* dpp, T *dest,
                               optional_yield y, E *err_result)
 {
   int ret = req.wait(dpp, y);
-  if (ret == -EIO) {
+  if (ret == -ERR_INTERNAL_ERROR) {
     conn->set_url_unconnectable(req.get_url_orig());
   }