Repository navigation
osd: rep_repair_primary_object needs to cope with balanced/localized reads - #70909
Conversation
…reads If a balanced/localized read is sent to a replica (as opposed to the primary) and this read then fails (e.g. because of a media error) then rep_repair_primary_object is called which previously asserted because recovery can only be performed by the primary. Fix this by having replica's fail the op with EAGAIN back to the client rather than attempt recovery. The client will retry the request to the primary which will most likely read the data from another copy. If the primary needs to recover the object it may re-encounter and deal with the error as it processes the read, otherwise the next scrub cycle will find and deal with the error. Fixes: https://tracker.ceph.com/issues/76957 Signed-off-by: Bill Scales <[email protected]> Assisted-by: IBM Bob 2.0.1
JonBailey1993
left a comment
There was a problem hiding this comment.
Copilot's comment about the performance counter is interesting, but outside that, this looks good to me.
aainscow
left a comment
There was a problem hiding this comment.
LGTM.
It took me a while, as there is a lot of subtlety around this code, but I think it is correct.
-
At the point this code is called "-EAGAIN" being returns essentially means "drop me" - but it looks like the non-primary sends the necessary reply, so handles this well.
-
You can have EC DIRECT READS at a PRIMARY - this is moot because you cant fix EC objects like this at all...
-
You can have balanced / localize reads at the primary... potentially split versions. But I think we can safely wait and repair the object at this point... or we won't be in here because we cant calculate a checksum on a non-full read.
Maybe the commit message could go into a bit more detail, but I think the code is correct.
|
This PR has been added to wip-bharath12-testing-20260911.231931-main. |
|
jenkins test api |
|
This is an automated message by src/script/redmine-upkeep.py. I found one or more
The referenced tickets are: Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them. |
If a balanced/localized read is sent to a replica (as opposed to the primary) and this read then fails (e.g. because of a media error) then rep_repair_primary_object is called which previously asserted because recovery can only be performed by the primary.
Fix this by having replica's fail the op with EAGAIN back to the client rather than attempt recovery. The client will retry the request to the primary which will most likely read the data from another copy. If the primary needs to recover the object it may re-encounter and deal with the error as it processes the read, otherwise the next scrub cycle will find and deal with the error.
Fixes: https://tracker.ceph.com/issues/76957
See also #69234 which is an alternative fix
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.