Repository navigation
rgw: reread the olh head after replaying its log - #71924
Conversation
|
I've re-run my reproducer against this change for a full ten minutes, and I encountered zero 404s over ~45k requests. Without the patch I can reproduce it in ~40 seconds. Awesome work, thank you Matt! |
4d51cf7 to
9211ada
Compare
a4cb100 to
7bbb847
Compare
| if (state->attrset.find(RGW_ATTR_OLH_INFO) == state->attrset.end()) { | ||
| return -ENOENT; // no version was ever linked | ||
| } | ||
| obj_ctx.invalidate(olh_obj); | ||
| return -EAGAIN; |
There was a problem hiding this comment.
@mheler you mentioned that this is getting more and more complicated as we dig into it. my understanding of the originial issue is that get requests were incorrectly returning 404s. i see that you've made this check for the ENOENT/404 case more specific
instead of adding additional recovery for the non-404 case here, perhaps we'd be better off just translating this to a retryable error code and expecting the client to come back. that could at least avoid use-after-free of RGWObjState due to this invalidate() call
7bbb847 to
79ebf42
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
712389d to
9114c88
Compare
cbodley
left a comment
There was a problem hiding this comment.
looks okay, assuming qa doesn't catch any regressions
i'd still consider returning a retryable error directly, without the internal invalidate/retry logic
|
This PR has been added to wip-yuri12-testing-20261013.170323-main. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
When concurrent olh log replays race, the canceled replay can cause a read to return 404 even though the object still exists. Reset the cached olh state in place so get_obj_state() rereads the olh head and replays the log again, and return 503 after five failed attempts. The replay that won has usually applied the log by then. The state is reset rather than invalidated because callers hold pointers to it. A head with no version ever linked still returns ENOENT. Signed-off-by: Matthew N. Heler <[email protected]>
follow_olh() decodes the current version from the cached OLH_INFO, which apply_olh_log() never updated, so a read that replayed the olh log could still follow the version that was current before the replay. Apply the same xattr changes to the cached olh state once the head write succeeds, so we follow the new current version without another read. Have follow_olh() also drop the unexpired pending entries it found, which the log may not cover yet, so a later follow in the same request can't pick up a newer link and switch versions. Signed-off-by: Matthew N. Heler <[email protected]>
After clear_olh() removes the olh head, the cached state still said it existed. A delete that replayed the olh log would then fail to write its delete marker, and a read that replayed the removal of the last version would still follow it. Mark the cached head as removed once clear_olh() removes it, and have follow_olh() return ENOENT when its replay removed the head. Signed-off-by: Matthew N. Heler <[email protected]>
Versioned writes and delete markers look up the current version only to check preconditions against it. Since a canceled olh log replay now ends in 503 instead of ENOENT, a write without preconditions would fail on a lookup it never uses, where it used to go through. The lookup also costs extra head reads and can replay the olh log. DeleteObjects has the same problem with its state load: it fails a key on any error but ENOENT, while DeleteObject only fails when it needs the state for object lock. Only look up the current version when the request has a precondition, and have DeleteObjects fail a key on a state load error only when it checks object lock, as DeleteObject does. Signed-off-by: Matthew N. Heler <[email protected]>
Raise the olh version so olh log replay fails, then delete the current object version, delete the object with DeleteObjects, and write a new one. Check that the deletes and the write succeed and reads return 503 while replay keeps failing, then restore the olh version and check that reads return the new version. Also check that a delete writes its delete marker after the olh log replay removes the olh head. Signed-off-by: Matthew N. Heler <[email protected]>
pr testing completed and approved by @ivancich, more details in : https://tracker.ceph.com/issues/81731 |
If an MPU is uploaded to a non-default storage class, its part heads are located in that class, not the bucket's default pool, so get_part_obj_state() has to resolve them with the upload's placement instead of always looking in the bucket's default pool. get_obj_state() now takes an optional placement rule that overrides the bucket's, and get_part_obj_state() passes the manifest's tail placement. GetObjectAttributes with ObjectParts goes through the same function, so for uploads in a non-default storage class it now also reports the part checksums, and the part sizes instead of their compressed sizes if the class is compressed. Fall back to the bucket's default pool if the part head isn't in the tail placement's pool or has no etag: releases before v16.2.8 (https://tracker.ceph.com/issues/49128) wrote the part head's attrs, including compression info, to a zero-size object in the bucket's default pool and left the part data in the class pool without attrs, so reading those parts from the class pool alone would return compressed data. Fixes: https://tracker.ceph.com/issues/81780 Signed-off-by: Oguzhan Ozmen <[email protected]> (cherry picked from commit a1775f9) Conflicts: src/rgw/driver/rados/rgw_rados.cc - Tentacle doesn't have the recent main change that retries canceled olh log replay #71924
A versionless read that lost a race with another OLH log replay could return ECANCELED, which was incorrectly translated into a 404.
follow_olh()now rereads the OLH head after any replay and uses it to resolve the target. This adds one extra head read only when a replay runs.The included QA test forces a replay to lose this race and verifies that reads still resolve correctly. It then allows the replay to complete and verifies that a subsequent read returns the version linked by that replay.
Fixes: https://tracker.ceph.com/issues/80653
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. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.