Repository navigation
osd/ECExtentCache: hold reads behind a cache invalidation, pin growth holes - #72683
Conversation
afba782 to
26ec0f3
Compare
bill-scales
left a comment
There was a problem hiding this comment.
LGTM - Blocking reads until the invalidating write calls write_done() is the correct and minimal fix. The write transactions have been submitted by this point so any future read that is issued will not overtake the writes.
Pinning the hole is a reasonable way of stopping reads to that region until the write completes.
|
This PR has been added to wip-bharath17-testing-20261016.230103-main. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
26ec0f3 to
5a4aacd
Compare
When an op grows an object, Object::request() adds the gap between the old and new projected size to do_not_read, so later ops do not read data that is not yet on disk. do_not_read entries are erased a line at a time when the last op pinning the line dies, but the growing op only pinned the lines of its own reads and writes. An older op pinning a line inside the hole could therefore die first and erase that part of the hole while the growing op was still waiting for its cache_ready, before current_size was updated. A following op would then send reads in the hole with the old current_size, none survived the read mask, and do_read_op hit ceph_assert(reads_sent). Pin every line the hole spans, so that it lives until the growing op completes. Fixes: https://tracker.ceph.com/issues/81315 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
An op that invalidates the extent cache (a clone or rollback onto the object, a remove and recreate, a shrinking truncate) waits at the head of the queue for the object's reads, then invalidate() clears the cache and replays every op queued on the object. The replayed ops' reads are sent straight away, but the invalidating op's write is only issued once all the cache ops of its transaction are ready, after them. Unless the invalidating op has reads of its own, the queued ops therefore read the object as it was before it: the old data instead of the clone's, or instead of the zeros a truncate or recreate leaves, which they write back into the parts of their pages they do not overwrite. Reads past the old size are dropped by the read mask, so a queued op that only reads there hits ceph_assert(reads_sent). Hold the reads of the ops replayed behind the invalidating op until write_done() for it. That runs after its sub-writes have been sent, and sets current_size to the size the reads are made against. a970eae (since reverted) avoided the assert by replaying from current_size, which makes the growth to the invalidating op's size a hole. For a clone or rollback that region holds the source's data, which the queued ops replaced with zeros. Fixes: https://tracker.ceph.com/issues/81754 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
5a4aacd to
367d236
Compare
|
@aainscow was the latest force push trivial? Since we don't know, I removed it from the current QA batch and it will be added to the next. |
|
@ljflores force push was a trivial rebase. I have updated my process now to make a note of this in a comment. |
|
Thanks for clarifying; we will still consider the results valid. |
|
Category: Description references superseding #72331 and coordinating with #72684. pr-triage lists all three still open. A single canonical PR link in the descriptions may help reviewers. pr-triage note — automated candidate for human review only, not a maintainer decision. Snapshot 2026-11-10 against open PR bases. pr-triage is a personal read-only assistant by @RaminNietzsche; not affiliated with or endorsed by the Ceph project. Please verify (rebase, git cherry, tracker) before acting. |
|
We hit https://tracker.ceph.com/issues/81754 in production on 20.2.3. It's a 6+2 pool with We built ceph-osd from v20.2.3 with both commits from this PR (as of 367d236) and rolled it to all 54 OSDs at 19:10 UTC yesterday. There hasn't been a Thanks for the fix. A tentacle backport would really help us. |
I am waiting for RADOS approved following testing. Once that happens, I will make a backport, but it can take a little while to get in. |
|
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. |
Stacked on #72666 (the revert of #70377); only the last two commits are new to this PR. The tests are in #72684.
Fixes two defects in the Fast EC extent cache. The full description is in https://tracker.ceph.com/issues/81754.
1. Reads replayed after a cache invalidation overtake the invalidating write. An op that invalidates the cache (a clone or rollback onto the object, a remove and recreate, a shrinking truncate) waits at the head of the queue. Then
ECExtentCache::Object::invalidate()replays the ops queued behind it on the same object and sends their reads at once. The invalidating op's sub-writes are only sent once all the cache ops of its transaction are ready, after those reads. Unless the invalidating op reads something itself, the queued writes read the object as it was before it:ceph_assert(reads_sent).The reverted #70377 turned the assert into zero-fill (https://tracker.ceph.com/issues/81611). Now the reads of the replayed ops wait for
write_done()of the invalidating op, which runs after its sub-writes are sent and setscurrent_size.2. A growth hole is erased by an older op's cache line (https://tracker.ceph.com/issues/81315, from #72331, unchanged). The growing op now pins every line its hole spans. This matches the
ceph_assert(reads_sent)crash reports on https://tracker.ceph.com/issues/78465 (tentacle 20.2.1/20.2.2).Both commits cherry-pick cleanly onto tentacle after #72650.
Supersedes #72331 (fix) and, with #72684, #72332 and #72566 (tests).
Results with the tests from #72684, on main with #70377 reverted (10 optimized EC configurations per peering test):
TestECInvalidateReplay.Rollbackceph_assert(reads_sent)TestECInvalidateReplay.CachedRollbackTestECInvalidateReplay.TruncateGrowTestECInvalidateReplay.CachedRecreateTestECInvalidateReplay.RecreateTestECInvalidateReplay.TruncateGrowShortShardTestECInvalidateReplay.UnalignedTruncate(control)TestECRollbackPartialWrites.*(4 tests; 3 zero-fill with #70377)TestECFailoverWithPeering.ExtentCacheGrowthHoleErasedByLineDeathECExtentCache.HoleErasedByOlderOpLineDeath,HoleErasedBeforeReadDoneSendReadsECExtentCache.CloneInvalidateStaleSizeTestBackendBasics.TruncateGrowWithSuspendedReads,RollbackInvalidateRealisticWith this PR and #72684 merged into main, all of
unittest_ecfailover_with_peering(338),unittest_backend_basics(888),unittest_extent_cache(12),unittest_ecbackend,unittest_ec_with_crush,unittest_ec_transaction,unittest_ecutil,unittest_ec_omap_journaland the_lvariants pass. The new and rollback tests passed 600/600 over 5 repeats. Locally, the ctest unit tests pass (218/219:run-cli-testsfails only onradosgw-admin/help.t, as RGW was not built), as dosmoke.sh,safe-to-destroy.sh,crush_weights.shandrun-rbd-unit-tests-*.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.
🤖 Generated with Claude Code