Repository navigation
osd/ECTransaction: truncate padded shards of legacy EC objects - #72853
Conversation
|
@aainscow hi Alex, do you mind reviewing this change? |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
I'm not sure / doubt whether there was an intention to allow turning a pool into a FastEC if it already stores data. |
neither am i. but from user's perspective, if it's not prohibited, it's allowed. and the most scaring thing is, our (Proxmox) user actually did, and this caused data lost =( do we have document documenting the constraint in this regards? |
6161b33 to
773350d
Compare
It was intended. The docs say the flag "may be enabled for existing pools" (erasure-code.rst), and the optimized code is meant to tolerate shards that still have the legacy size. Truncate missed a case, so this is a real bug. The fix looks right to me. We have seen a lot of bugs when truncates are combined with writes, so I wanted to make sure this new kind of truncate doesn't run into any of them. I've pushed three test commits on top; keep them separate or squash them, whichever you prefer:
Without the fix, 56 of the 86 legacy runs in Some notes, none of them blocking:
I've also run this on top of the other open truncate fixes (#72138, #72140, #72683 and #72684), with legacy variants of their tests, including the rollback tests and the truncate matrix. They all pass, and when I put back the truncate bugs fixed earlier, the legacy variants catch every one that the original tests catch. Those tests need the other PRs, so they will follow there. |
aainscow
left a comment
There was a problem hiding this comment.
LGTM (I have done quite a bit of extra testing here, due to paranoia).
|
jenkins test make check |
|
jenkins test make check arm64 |
|
jenkins test make check |
Without EC optimizations, every shard of an EC object is padded to the stripe boundary. Once allow_ec_optimizations is set on the pool, a truncate shrinks only some of the shards. The rest keep their padding. For the user this means deep scrub reports the object inconsistent, and "ceph pg repair" makes it worse. If more than m shards are too long, repair marks them all missing and the object ends up unfound, even though its data is intact. To get the PG clean again, the operator is likely to run "ceph pg mark_unfound_lost delete", and that does lose the object. RBD hits this most often, as librbd sends a discard or write-zeroes at the end of an object as a truncate (https://tracker.ceph.com/issues/81915). The fix is under review for main (ceph/ceph#72853) and has no tentacle backport yet, so no point release carries it. Carry my cherry-pick until then. It leaves out the new unit tests, which tentacle cannot build, and drops out on the next rebase. Signed-off-by: Kefu Chai <[email protected]> Link: https://lore.proxmox.com/[email protected]
|
i think the test failure of unittest_backend_basics is addressed by #72683 |
|
This PR has been added to wip-bharath10-testing-20261109.054620-main. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
@tchaikov JFYI needs a rebase |
773350d to
f2ccc27
Compare
thanks. rebased. |
Without EC optimizations, every shard of an EC object is padded to the stripe boundary. After allow_ec_optimizations is set on the pool, truncate() only shrinks the shards whose optimized size, computed from the old object size, is larger than the new one. The other shards keep the legacy padding, so scrub finds them too long and flags the object inconsistent. With 4+2 and 4K chunks, all six shards of a 20K object are 8K. Truncate it to 16K, and shards 1-3 stay at 8K instead of 4K. RBD hits this when a discard or write-zeroes reaches the end of an object, since librbd sends that as a truncate. With more than m shards flagged, "ceph pg repair" marks them all missing and the object ends up unfound, while its data was fine. So truncate the remaining shards to their new size as well. Objects written with EC optimizations already have that size. Extending the rollback clone to cover the padding instead doesn't work: the primary doesn't know how long it is, and BlueStore rejects a clone_range past the end of an object. Fixes: https://tracker.ceph.com/issues/81915 Signed-off-by: Kefu Chai <[email protected]>
f2ccc27 to
4674973
Compare
Umbrella 21.2.0 still has the EC truncate bug that tentacle-stable-9 already carries a fix for. On pools with allow_ec_optimizations set, a truncate leaves the legacy stripe padding on some shards. Deep scrub then flags the object inconsistent, and a repair can leave it unfound although its data is intact. The fix is still under review upstream (ceph/ceph#72853), so carry its current version. Like the Tentacle backport, it leaves out the new unit tests, which build on test fixture helpers that only exist on main. Signed-off-by: Thomas Lamprecht <[email protected]>
Without EC optimizations, every shard of an EC object is padded to the stripe boundary. After allow_ec_optimizations is set on the pool, truncate() only shrinks the shards whose optimized size, computed from the old object size, is larger than the new one. The other shards keep the legacy padding, so scrub finds them too long and flags the object inconsistent.
With 4+2 and 4K chunks, all six shards of a 20K object are 8K. Truncate it to 16K, and shards 1-3 stay at 8K instead of 4K. RBD hits this when a discard or write-zeroes reaches the end of an object, since librbd sends that as a truncate. With more than m shards flagged, "ceph pg repair" marks them all missing and the object ends up unfound, while its data was fine.
So truncate the remaining shards to their new size as well. Objects written with EC optimizations already have that size. Extending the rollback clone to cover the padding instead doesn't work: the primary doesn't know how long it is, and BlueStore rejects a clone_range past the end of an object.
Fixes: https://tracker.ceph.com/issues/81915
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.