Repository navigation
Conversation
e8773fb to
52346d7
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
52346d7 to
eca1b28
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Move MockPGBackendListener::get_tid() out of line into a new .cc file and delegate to PGBackendTestFixture::get_tid(). This mirrors production where OSDService::get_tid() is a single atomic counter shared by both PrimaryLogPG and the EC/Replicated backends, avoiding TID collisions between client-op TIDs and backend-internal read/rollforward TIDs. Signed-off-by: Alex Ainscow <[email protected]> Assisted-by: IBM-Bob:Claude Sonnet/GPT-5
Adds a regression test for the production crash where ceph_assert(reads_sent) fires in do_read_op after a clone+write pair is processed by the extent cache. The scenario: a clone target op (invalidates_cache=true, current_size=0) is submitted together with a HEAD RMW op in the same execute() call. cache_maybe_ready fires the clone target's invalidation before the HEAD op completes, which clears do_not_read but does not re-add the growth hole (0 → projected_size). A subsequent op on the clone oid then has reads that survive the empty do_not_read, and send_reads fires with current_size=0, causing the assert. The test asserts that after the fix (invalidate() resets projected_size to current_size so the growth hole is re-added during replay) no backend_read is issued for the clone oid. Also introduces the MultiClient test fixture, shared across multi- object cache scenarios. Signed-off-by: Alex Ainscow <[email protected]> Assisted-by: IBM-Bob:Claude Sonnet/GPT-5
eca1b28 to
f3d58a7
Compare
f3d58a7 to
6e6b0a0
Compare
bill-scales
left a comment
There was a problem hiding this comment.
Functionally ok, a few nits
| */ | ||
| int create_snapshot( | ||
| const std::string& obj_name, | ||
| uint64_t snap_size); |
There was a problem hiding this comment.
nit: For consistency shouldn't there be a "bool run = true" parameter on create_snapshot that decides whether event_loop->run_until_idle() gets called?
| const auto& backend_config = GetParam().backend; | ||
|
|
||
| if (backend_config.pool_type != EC) { | ||
| GTEST_SKIP() << "DelayedShardWrite test only applies to EC backends"; |
There was a problem hiding this comment.
s/DelayedShardWrite/TruncateGrowWithSuspendedReads
| } | ||
|
|
||
| // Emulate a rollback operation. We use multiple objects here in an attempt | ||
| // to prov |
There was a problem hiding this comment.
nit: unfinished comment
| } | ||
|
|
||
| { | ||
| ASSERT_EQ(-EINPROGRESS, write(obj, object_size, stripe_width, |
There was a problem hiding this comment.
nit: Hard to review. Maybe rename write to truncate_and_write to make it clearer what this op is?
Replace the hand-rolled CloneInvalidateStaleCacheSize test with two cleaner, higher-signal tests that cover the same invalidate/projected_size bug and its realistic production sequencing: * TruncateGrowWithSuspendedReads Suspends shard 0 I/O, then queues three overlapping writes (a partial write into stripe 1, a truncate-grow to stripe 3, and a partial write into the new stripe) before draining the event loop. Exercises the path where a grow-hole is computed while reads for a prior operation are still in-flight. * RollbackInvalidateRealistic Mirrors the production sequence that triggers the bug: an unrelated object's RMW write is submitted first (blocking waiting_ops), then a rollback (clone→HEAD) on a second object, then a partial write on that same object — all without draining the event loop between submissions. When the event loop drains, the rollback's invalidation fires with stale projected_size, leaving the subsequent write's read sub-op with current_size=0, hitting ceph_assert(reads_sent). Supporting fixture changes: - Add optional bool run (default true) parameter to do_transaction_and_complete(), write(), and the multi-write write() overload so callers can submit transactions without draining the event loop. - Add rollback() helper that constructs a remove+clone transaction and wires up the standard OBC/outstanding-write bookkeeping. - Remove stale comment from on_complete lambda in do_transaction_and_complete(). Signed-off-by: Alex Ainscow <[email protected]> Assisted-by: IBM-Bob/Claude Sonnet/GPT-5 Signed-off-by: Alex Ainscow <[email protected]>
6e6b0a0 to
05fe457
Compare
|
jenkins test api |
2 similar comments
|
jenkins test api |
|
jenkins test api |
This series adds and refactors regression tests for a crash in the EC extent cache where ceph_assert(reads_sent) fires in do_read_op after a clone or rollback operation races with an in-flight RMW.
NOTE: No fix is included here, as we want to backport the FIX, but we do not want to backport the test harness.
Depends-on: #69662
Depends-on: #70377
Root cause (in brief):
When ECExtentCache::invalidate() fires for an op with invalidates_cache=true (e.g. a clone target), it clears do_not_read and sets projected_size to the op's projected_size — but does not re-add the growth hole from current_size=0 → projected_size. A subsequent op on the same object then computes reads that survive the now-empty do_not_read, and send_reads fires with current_size=0, causing the assert.
Changes:
test/osd: centralise TID generation in PGBackendTestFixture
Moves MockPGBackendListener::get_tid() out-of-line into a new .cc file and delegates it to PGBackendTestFixture::get_tid(). This mirrors production — OSDService::get_tid() is a single atomic counter shared across PrimaryLogPG and all EC/Replicated backends — so backend-internal read/rollforward TIDs no longer collide with client-op TIDs during multi-op tests.
test/osd: add CloneInvalidateStaleSize extent cache test
Adds a unit-level regression test directly against ECExtentCache (in test_extent_cache.cc). Uses the new MultiClient fixture to reproduce the exact state machine sequence: clone target op (invalidates_cache=true, current_size=0) and an RMW op submitted together in a single execute() call. Asserts that after the fix no backend_read is issued for the clone oid on the subsequent op.
test/osd: refactor EC extent-cache bug regression tests
Replaces the hand-rolled CloneInvalidateStaleCacheSize test with two higher-level integration tests in TestBackendBasics:
TruncateGrowWithSuspendedReads — suspends shard 0 I/O, then queues three overlapping ops (partial write → truncate-grow → partial write into the new stripe) before draining. Exercises the grow-hole computation while reads for a prior op are still in-flight.
RollbackInvalidateRealistic — mirrors the production sequence: an unrelated object's RMW is submitted first (blocking waiting_ops), then a rollback (clone→HEAD) on a second object, then a partial write on that object — all without draining the event loop between submissions. Triggers the projected_size/growth-hole bug in the realistic ordering.
Supporting fixture additions: do_transaction_and_complete(), write(), and the multi-write write() overload all gain an optional bool run parameter (default true) to allow submitting transactions without draining the event loop; a new rollback() helper constructs the remove+clone transaction with correct OBC and outstanding-write bookkeeping.
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.