Repository navigation
rgw/multisite: retry radosgw-admin sync status on endpoint connection failures - #52812
jzhu116-bloomberg wants to merge 1 commit into
Conversation
56cefaf to
2d55a48
Compare
| for (int i = 0; i < MAX_RETRIES; i++) { | ||
| ret = run(dpp, new RGWReadRemoteDataLogInfoCR(&sc, &shards, shards_info)); |
There was a problem hiding this comment.
i feel like these retries would be better handled at the shard level in RGWReadRemoteDataLogShardInfoCR. we shouldn't need to wait for all completions before attempting any retries
then RGWReadRemoteDataLogInfoCR doesn't need to track the set of completed shards, nor would the RGWShardCollectCR changes be needed to map errors back to their shards
same goes for the RGWReadRemoteMDLogInfoCR changes
There was a problem hiding this comment.
Yup agree that it's the better place to handle it.
This original commit was to limit the changes only to the radosgw-admin command part so I wouldn't inadvertently introduce inappropriate logic to other workflows, until some experienced rgw developers suggested otherwise, which I got here. Thanks!
I'll make the changes.
There was a problem hiding this comment.
wouldn't inadvertently introduce inappropriate logic to other workflows
i see what you mean. for the sync logic, i do think it's much better to handle these retries locally instead of relying on sync's higher-level retry mechanisms. those tend to be a lot more expensive, potentially requiring writes to the data sync error repo, and re-reads of sync status and replication logs
There was a problem hiding this comment.
Changes have been committed to move the retry logic down to RGWReadRemoteDataLogShardInfoCR and RGWReadRemoteMDLogShardInfoCR. And also add the retry to RGWListRemoteDataLogShardCR and RGWListRemoteMDLogShardCR as well. Ready to be reviewed again.
|
|
||
| CephContext *cct; | ||
| std::vector<std::string> endpoints; | ||
| std::unordered_map<std::string, conn_status> endpoints_status; |
There was a problem hiding this comment.
currently, at least some of the RGWRESTConn instances are global to RGWSI_Zone and rely on the atomic counter for thread-safety. if we're adding additional state here, that would require a mutex. i'd really prefer to avoid that
is this RGWRESTConn change necessary to resolve the radosgw-admin case, or might we discuss this part in a separate pr?
There was a problem hiding this comment.
This RGWRESTConn change is not necessary to resolve the radosgw-admin case, but make the logic (not only in radosgw-admin case) more efficient by avoiding some unnecessary retries.
This extra endpoints_status is only populated in the constructor of RGWRESTConn and the map won't be manipulated afterward. It's true that the status of each endpoint would be updated but I understood that it would be handled asyncly via coroutine and would not be accessed simultaneously in multi-thread env for each endpoint? I haven't dug thoroughly into the bottom of the code yet so my understanding might be wrong here..
There was a problem hiding this comment.
I haven't dug thoroughly into the bottom of the code yet so my understanding might be wrong here..
i think you're right here. i was worried that metadata sync and data sync may share the same RGWRESTConn instance for the master zone, but i see that RGWSI_Zone creates a separate rest_master_conn for metadata sync
that said, i think it would be better for each sync thread to manage its own RGWRESTConn instance explicitly. these could be member variables of RGWDataSyncStatusManager and RGWMetaSyncStatusManager/RGWRemoteMetaLog instead of pointers; they'd only need to read the 'global' list of zone endpoints from RGWSI_Zone on construction
that encapsulation would help to prevent us from adding other thread-unsafe accesses to the members of RGWSI_Zone, and we could avoid the use of atomics in RGWRESTConn by documenting that it's not thread-safe
There was a problem hiding this comment.
Yup this makes sense to me. I'll make the changes in a separate PR (as you suggested in an earlier comment) since it's not a necessary change to solve this radosgw-admin sync status issue.
There was a problem hiding this comment.
After reading the code more carefully, I do notice that rest_master_conn is actually accessed by multiple threads: metadata sync thread, data sync thread, sync log trim thread, and rgw requests handling threads. And RGWRESTConn instance for each zone is accessed by multiple threads too.
I'll put this part in a separate PR and discuss what's the best way to handle this there.
There was a problem hiding this comment.
This change will be submitted as part of the PR for the issue https://tracker.ceph.com/issues/62710
cbodley
left a comment
There was a problem hiding this comment.
review of the RGWRESTConn changes
| struct conn_status { | ||
| bool connectable; | ||
| ceph::real_time last_status_update; | ||
| }; |
There was a problem hiding this comment.
endpoints_status could probably just be a std::map<std::string, ceph::real_time> that only stores the failed endpoints. std::unordered_map is probably overkill when we only expect a handful of endpoints per zone. boost::container::flat_map could be a good alternative to reduce memory allocations
| if (ret == -EIO) | ||
| set_url_unconnectable(url); |
There was a problem hiding this comment.
style nit: please use curly-braces even for single statements, see https://github.com/ceph/ceph/blob/main/CodingStyle#L84-L103
| if (ret == -EIO) | ||
| set_url_unconnectable(url); |
There was a problem hiding this comment.
would errors from send_request() ever indicate a connection error? my understanding is that just signs the request and enqueues it for sending. i think we should only handle the errors from complete_request()
| RGWRESTReadResource::~RGWRESTReadResource() | ||
| { | ||
| if (req_ret == -EIO) { | ||
| conn->set_url_unconnectable(url); | ||
| } |
There was a problem hiding this comment.
i'm guessing you're using destructors this way just to avoid duplicating the checks for send_request() and complete_request()? i'm hoping that we don't need the checks for send_request(), and i think it would be clearer if was in the error path itself
2d55a48 to
cbf7802
Compare
cbf7802 to
6ee6f87
Compare
… failures Signed-off-by: Juan Zhu <[email protected]>
6ee6f87 to
cf44470
Compare
| yield return state_init(); | ||
| yield return state_send_request(dpp); | ||
| yield return state_request_complete(); | ||
|
|
There was a problem hiding this comment.
The reason why I added the retry logic here instead of RGWListRemoteMDLogShardCR and RGWListRemoteDataLogShardCR is that we may need this retry logic for more child classes of RGWSimpleCoroutine in the fix for https://tracker.ceph.com/issues/62710.
|
all the changes in this PR have been covered in #53320. Close this one. |
Maintain endpoint connectable status in RGWRESTConn, and retry getting remote shard info upon endpoint IO failures while running radosgw-admin (data) sync status commands.
Fixes: https://tracker.ceph.com/issues/53029
Signed-off-by: Jane Zhu [email protected]
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows