Skip to content

Commit 95b5ff2

Browse files
authored
Merge pull request ceph#63303 from mkogan1/wip-eio-to-err_internal
rgw/multisite: change HTTP error handling from EIO to ERR_INTERNAL_ERROR Reviewed-by: Casey Bodley <[email protected]>
2 parents 135cf5d + dbb409e commit 95b5ff2

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

src/rgw/driver/rados/rgw_data_sync.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ class RGWReadRemoteDataLogShardInfoCR : public RGWCoroutine {
286286
}
287287

288288
if (op_ret < 0) {
289-
if (op_ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
289+
if (op_ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
290290
ldpp_dout(dpp, 20) << "failed to fetch remote datalog shard info. retry. shard_id=" << shard_id << dendl;
291291
continue;
292292
} else {
@@ -389,7 +389,7 @@ class RGWReadRemoteDataLogShardCR : public RGWCoroutine {
389389
}
390390

391391
if (op_ret < 0) {
392-
if (op_ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
392+
if (op_ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
393393
ldpp_dout(dpp, 20) << "failed to read remote datalog shard. retry. shard_id=" << shard_id << dendl;
394394
continue;
395395
} else {

src/rgw/driver/rados/rgw_rados.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4256,7 +4256,7 @@ int RGWRados::stat_remote_obj(const DoutPrefixProvider *dpp,
42564256
ret = conn->complete_request(dpp, in_stream_req, nullptr, &set_mtime, psize,
42574257
nullptr, pheaders, y);
42584258
if (ret < 0) {
4259-
if (ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
4259+
if (ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
42604260
ldpp_dout(dpp, 20) << __func__ << "(): failed to fetch object from remote. retries=" << tries << dendl;
42614261
continue;
42624262
}
@@ -4523,7 +4523,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& dest_obj_ctx,
45234523
ret = conn->complete_request(rctx.dpp, in_stream_req, &etag, &set_mtime,
45244524
&accounted_size, nullptr, nullptr, rctx.y);
45254525
if (ret < 0) {
4526-
if (ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
4526+
if (ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
45274527
ldpp_dout(rctx.dpp, 20) << __func__ << "(): failed to fetch " << fetched_obj
45284528
<< " from remote. retries=" << tries << dendl;
45294529
continue;
@@ -4802,7 +4802,7 @@ int RGWRados::copy_obj_to_remote_dest(const DoutPrefixProvider *dpp,
48024802

48034803
ret = rest_master_conn->complete_request(dpp, out_stream_req, etag, mtime, y);
48044804
if (ret < 0) {
4805-
if (ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
4805+
if (ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
48064806
ldpp_dout(dpp, 20) << __func__ << "(): failed to put_obj_async_init. retries=" << tries << dendl;
48074807
continue;
48084808
}

src/rgw/driver/rados/rgw_sync.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ class RGWReadRemoteMDLogShardInfoCR : public RGWCoroutine {
510510
}
511511

512512
if (op_ret < 0) {
513-
if (op_ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
513+
if (op_ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
514514
ldpp_dout(dpp, 20) << "failed to read remote metadata log shard info. retry. shard_id=" << shard_id << dendl;
515515
continue;
516516
} else {
@@ -1094,7 +1094,7 @@ class RGWReadRemoteMetadataCR : public RGWCoroutine {
10941094
}
10951095

10961096
if (op_ret < 0) {
1097-
if (op_ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
1097+
if (op_ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
10981098
ldpp_dout(dpp, 20) << "failed to read remote metadata. retry. section=" << section << " key=" << key << dendl;
10991099
continue;
11001100
} else {
@@ -2440,7 +2440,7 @@ int RGWCloneMetaLogCoroutine::operate(const DoutPrefixProvider *dpp)
24402440
return state_receive_rest_response();
24412441
}
24422442

2443-
if (op_ret == -EIO && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
2443+
if (op_ret == -ERR_INTERNAL_ERROR && tries < NUM_ENPOINT_IOERROR_RETRIES - 1) {
24442444
ldout(cct, 20) << __func__ << ": request IO error. retries=" << tries << dendl;
24452445
continue;
24462446
} else if (op_ret < 0) {
@@ -2547,7 +2547,7 @@ int RGWCloneMetaLogCoroutine::state_send_rest_request(const DoutPrefixProvider *
25472547
int RGWCloneMetaLogCoroutine::state_receive_rest_response()
25482548
{
25492549
op_ret = http_op->wait(sync_env->dpp, &data, null_yield);
2550-
if (op_ret < 0 && op_ret != -EIO) {
2550+
if (op_ret < 0 && op_ret != -ERR_INTERNAL_ERROR) {
25512551
error_stream << "http operation failed: " << http_op->to_str() << " status=" << http_op->get_http_status() << std::endl;
25522552
ldpp_dout(sync_env->dpp, 5) << "failed to wait for op, ret=" << op_ret << dendl;
25532553
http_op->put();
@@ -2557,7 +2557,7 @@ int RGWCloneMetaLogCoroutine::state_receive_rest_response()
25572557
http_op->put();
25582558
http_op = NULL;
25592559

2560-
if (op_ret == -EIO) {
2560+
if (op_ret == -ERR_INTERNAL_ERROR) {
25612561
return 0;
25622562
}
25632563

src/rgw/rgw_coroutine.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ int RGWSimpleCoroutine::operate(const DoutPrefixProvider *dpp)
10881088
yield return state_send_request(dpp);
10891089
yield return state_request_complete();
10901090

1091-
if (op_ret == -EIO && tries < max_eio_retries - 1) {
1091+
if (op_ret == -ERR_INTERNAL_ERROR && tries < max_eio_retries - 1) {
10921092
ldout(cct, 20) << "request IO error. retries=" << tries << dendl;
10931093
continue;
10941094
} else if (op_ret < 0) {
@@ -1129,7 +1129,7 @@ int RGWSimpleCoroutine::state_send_request(const DoutPrefixProvider *dpp)
11291129
int RGWSimpleCoroutine::state_request_complete()
11301130
{
11311131
op_ret = request_complete();
1132-
if (op_ret < 0 && op_ret != -EIO) {
1132+
if (op_ret < 0 && op_ret != -ERR_INTERNAL_ERROR) {
11331133
call_cleanup();
11341134
return set_state(RGWCoroutine_Error, op_ret);
11351135
}

src/rgw/rgw_rest_conn.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ class RGWRESTReadResource : public RefCountedObject, public RGWIOProvider {
357357
int wait(const DoutPrefixProvider* dpp, bufferlist *pbl, optional_yield y) {
358358
int ret = req.wait(dpp, y);
359359
if (ret < 0) {
360-
if (ret == -EIO) {
360+
if (ret == -ERR_INTERNAL_ERROR) {
361361
conn->set_url_unconnectable(req.get_url_orig());
362362
}
363363
return ret;
@@ -413,7 +413,7 @@ int RGWRESTReadResource::wait(const DoutPrefixProvider* dpp, T *dest,
413413
{
414414
int ret = req.wait(dpp, y);
415415
if (ret < 0) {
416-
if (ret == -EIO) {
416+
if (ret == -ERR_INTERNAL_ERROR) {
417417
conn->set_url_unconnectable(req.get_url_orig());
418418
}
419419
return ret;
@@ -488,7 +488,7 @@ class RGWRESTSendResource : public RefCountedObject, public RGWIOProvider {
488488
int ret = req.wait(dpp, y);
489489
*pbl = bl;
490490

491-
if (ret == -EIO) {
491+
if (ret == -ERR_INTERNAL_ERROR) {
492492
conn->set_url_unconnectable(req.get_url_orig());
493493
}
494494

@@ -509,7 +509,7 @@ int RGWRESTSendResource::wait(const DoutPrefixProvider* dpp, T *dest,
509509
optional_yield y, E *err_result)
510510
{
511511
int ret = req.wait(dpp, y);
512-
if (ret == -EIO) {
512+
if (ret == -ERR_INTERNAL_ERROR) {
513513
conn->set_url_unconnectable(req.get_url_orig());
514514
}
515515

0 commit comments

Comments
 (0)