Repository navigation
os/bluestore: tolerate corrupted onodes during fsck/repair - #69756
Conversation
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
16 similar comments
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
ok to test |
|
jenkins test make check |
|
The problem of decoding has 2 sides:
The solution has to convert asserts to something that will allow either to continue decoding (I discourage that) or abort decoding. |
aclamk
left a comment
There was a problem hiding this comment.
The failure of Onode decoding should be captured and handled in fsck case.
In regular operation case decoding failure should be considered fatal. That is, until we modify the code to handle error cases. The rationale is that we have redundancy; crashed OSD is not a problem, but OSD reporting incorrect state is.
|
Thanks @aclamk, that clarified the intended behavior. I've updated the patch accordingly: extent-map decode asserts now throw buffer::malformed_input, and fsck/repair catches buffer::error during onode decode to log/skip (or remove in repair) and continue. I also added tests covering both truncated-buffer and invalid extent-map version cases. |
|
jenkins test api |
…r policy Signed-off-by: Emily Leson <[email protected]>
d37f0b0 to
578564b
Compare
|
This PR has been added to wip-bharath5-testing-20260804.033808-main. |
|
cc @vumrao |
|
@emilytl can you please check the following test results? /a/skanta-2026-08-05_08:59:01-rados-wip-bharath5-testing-20260804.033808-main-distro-default-trial/432997/teuthology.log
i'll ask to remove that pr from that batch, please re-add needs-qa when the fix ready |
Signed-off-by: Emily Leson <[email protected]>
|
This PR has been removed from wip-bharath5-testing-20260804.033808-main. |
|
Fixed the death test failure |
|
ok to test |
|
jenkins test make check |
|
jenkins test make check arm64 |
|
This PR has been added to wip-bharath7-testing-20260811.152323-main. |
|
Looks like this one still in @SrinivasaBharath testing? |
|
/config check ok |
|
The comment above plus directing the config check to re-run cleared that check. |
|
This is an automated message by src/script/redmine-upkeep.py. I have resolved the following tracker ticket due to the merge of this PR: No backports are pending for the ticket. If this is incorrect, please update the tracker |
BlueStore fsck aborts on the first corrupted onode because decode validation uses ceph_assert. This makes decode failures recoverable for fsck only, leaving the regular I/O path unchanged.
Design: ceph_assert_decode() behaves exactly like ceph_assert by default and only diverges when fsck opts in via an RAII throwing_guard, throwing ceph::buffer::malformed_input so corruption is reported and skipped. Only asserts validating on-disk data were converted; program invariants stay fatal. fsck catches ceph::buffer::error at the object-walk sites, and exception safety was fixed for the newly throwable paths.
Allocation recovery: the post-crash rebuild that scans onodes (read_allocation_from_onodes and its multithreaded OnodeScanMT variant) also tolerates corruption, since that is where a crash-on-corrupt-onode lands at next mount. Tolerance requires an explicit caller opt-in that only read-only fsck requests; mount, repair, and trim stay fatal, because they either persist the rebuilt allocation or use it destructively. The new bluestore_accept_corrupted_onode_recovery option (never / read-only, default read-only) lets an operator disable tolerance entirely.
Unbounded allocations: a corrupt on-disk count can drive an allocation throwing std::bad_alloc/length_error, which slips past the fsck catches. These are now bounds-checked against the remaining buffer.
Tests: CorruptedOnodesTest covers truncated headers, bad struct_v, dangling blob indexes, and missing spanning blobs, with a death test confirming the regular path still crashes. Leak-safety verified under ASan; the decode-count guards have unit tests on a reusable expect_decode_tolerated() helper so bit-flip fuzzing can drop in later. Allocation recovery is covered end to end, single- and multi-threaded, via bluestore_debug_enforce_settings=ssd to reach NCB mode, plus a test that cold_open() (trim's entry point) still aborts where read-only fsck skips.
Out of scope (follow-ups): -EIO removal of unrecoverable objects, framework-wide denc reserve(num) hardening, and two-phase repair.
Fixes: https://tracker.ceph.com/issues/77325
Signed-off-by: Emily Leson [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. "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.