Repository navigation
crimson/seastore/rbm: implement capacity gating and resolve OOL write leakage - #69352
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. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds near-full/ENOSPC handling and leak prevention in Crimson SeaStore by exposing “storage full” state, gating write-like OSD ops early, and improving cleanup/retirement of extents during OMap node transformations.
Changes:
- Expose
is_storage_full()from RBM cleaner → EPM → TransactionManager → SeaStore/ShardServices and add a best-effort ENOSPC gate inOpsExecuter. - Fix/extend OOL write conflict handling with deferred-free backpressure and transaction pending-OOL tracking.
- Retire old OMap btree nodes’ logical addresses during split/merge/balance to avoid extent leaks.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/crimson/osd/shard_services.h | Adds shard-level helper to query local store near-full state. |
| src/crimson/osd/pg_backend.h | Extends write errorator to include enospc. |
| src/crimson/osd/ops_executer.cc | Early ENOSPC gate for data-allocating ops before creating a transaction. |
| src/crimson/os/seastore/transaction_manager.h | Forwards is_storage_full() from EPM. |
| src/crimson/os/seastore/transaction.h | Tracks/clears pending OOL write handle across transaction reuse/conflict. |
| src/crimson/os/seastore/seastore.h | Implements FuturizedStore is_storage_full() via TransactionManager. |
| src/crimson/os/seastore/random_block_manager/block_rb_manager.h | Makes free-blocks reporting reflect allocator state (or 0 pre-init). |
| src/crimson/os/seastore/random_block_manager/block_rb_manager.cc | Moves buffer into device write to avoid extra ref/copy. |
| src/crimson/os/seastore/omap_manager/btree/omap_btree_node_impl.cc | Retires old node logical addresses during node transforms to reclaim space. |
| src/crimson/os/seastore/extent_placement_manager.h | Adds storage-full query and conflict-pending-free accounting forwarding. |
| src/crimson/os/seastore/extent_placement_manager.cc | Wakes blocked IO after background process wake; adds OOL conflict drain gating. |
| src/crimson/os/seastore/cache.cc | Accounts deferred-free bytes when a pending OOL transaction conflicts. |
| src/crimson/os/seastore/async_cleaner.h | Adds RBM-only interfaces: storage-full, deferred-free backpressure/drain. |
| src/crimson/os/seastore/async_cleaner.cc | Implements RBM deferred-free accounting/drain; switches reserve check to allocator view. |
| src/crimson/os/futurized_store.h | Adds is_storage_full() virtual with default false for stores lacking support. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
b435c8f to
c85bb5d
Compare
|
@Matan-B gentle ping on this one. Since your 09-01 review the branch is just the two RBM commits (the #69351 commits dropped out after the rebase). Could a maintainer also add |
PR=wip-perezjos-crimson-only-07-10-2026-PR69352
$ teuthology-suite -m trial -s crimson-rados -p 101 --force-priority -c $PR -f debug --filter=seastore --suite-branch main --suite-repo https://github.com/ceph/ceph.git
2026-10-07 10:58:34,479.479 INFO:teuthology.suite.run:Test results viewable at
Jobs Tracker |
261e556 to
ab54420
Compare
|
@perezjosibm thanks for the run and the tracker. Bug #81552 was a real bug in this PR; fixed and pushed, rebased onto current main. Cause. All four failing jobs run a tiered store: Reproduced locally with a vstart crimson OSD using the same overrides ( A second, pre-existing bug surfaced in the same code on main: the writer snapshots the whole I confirmed it on unmodified main with a temporary log line in that ignored path, on the The PR is now three commits:
@Matan-B the code changed after your approval, so please take another look at commits 1 and 3. @perezjosibm could you re-run the crimson-rados seastore suite on the new head? |
…flict When a transaction is conflicted while an RBM OOL write is in flight, RandomBlockOolWriter frees the transaction's pre-allocated extents once the write completes, so the space is not reused under the outstanding I/O (829c857). It snapshots the whole pre_alloc_list for this and frees every extent through its own rb_cleaner. When both tiers of a tiered store are RANDOM_BLOCK, each tier has its own RandomBlockOolWriter and RBMCleaner (223dde6), and pre_alloc_list can hold extents of both. A conflict then frees the other tier's extents through a cleaner that does not own their device; RBMCleaner::mark_space_free() silently ignores such an address, so that space is never returned. A SEGMENTED cache tier is not affected, since only RBM extents are pre-allocated. Snapshot only the extents of the in-flight write. On conflict, defer just those; free the remaining pre-allocated extents immediately through ExtentPlacementManager::mark_space_free(), which routes by device id, since no I/O is outstanding on them. Signed-off-by: Shai Fultheim <[email protected]>
stats.used_bytes drifts from the block allocator: alloc_paddr and mark_space_used from existing_block_list are unmetered, so under sustained overwrite try_reserve_projected_usage() refuses writes long before the device is full, or overcommits and crashes the OSD. Derive used bytes from the AVL allocator instead: get_free_blocks() now reports the allocator's available size, and try_reserve_projected_usage(), get_stat() (hence is_storage_full() and statfs) and the rbm_cleaner metrics all read that view, so admission and operator-visible capacity agree. stats.used_bytes stays the fallback until the allocator is populated at mount. The failsafe threshold keeps tracking osd_failsafe_full_ratio. Reservation headroom drops from 5% to 1%: the allocator view already counts metadata extents, so only the in-flight surge before alloc_paddr commits needs cover. RBM has no cleaner, so a refused reservation can only be woken by an in-flight transaction releasing its projected usage. If none exists, admit the IO instead of blocking (a sole writer on a full device would otherwise deadlock) and let the allocator fail it with ENOSPC. Zero-usage reservations are always admitted: they cannot overcommit, and deletes, the space-releasing transactions, are metadata-only. Signed-off-by: Shai Fultheim <[email protected]>
A completed out-of-line write left t.pending_ool set. If the transaction was later marked conflicted, the already-written extents were treated as still in flight: their space was never freed and the conflict accounting leaked, eventually exhausting the allocator and deadlocking the OSD. Add Transaction::clear_pending_ool() and call it from the do_write() finally continuation, together with the conflict check and the deferred frees, so it runs on every exit path and is atomic w.r.t. reactor task interleaving; also clear it in Transaction::reset(). Track the bytes of conflicted OOL writes still in flight in RBMCleaner: new OOL writes wait (wait_for_conflict_drain) while they exceed 5% of data capacity, they count as a release source for the reservation gate, and draining them wakes blocked IO. The bytes are accounted through the same device-id routing as mark_space_free(), so on a tiered store they land on the cleaner of the writer that later deaccounts them. Fixes: https://tracker.ceph.com/issues/81552 Signed-off-by: Shai Fultheim <[email protected]>
ab54420 to
62c82d6
Compare
|
@perezjosibm, great catch! Moving back to "Needs QA" as the issues were addressed. |
$ PR=wip-perezjos-crimson-only-12-10-2026-PR69352
$ teuthology-suite -s crimson-rados -p 101 --force-priority -c $PR -f debug --filter seastore --suite-branch main --suite-repo https://github.com/ceph/ceph.git
2026-10-12 15:46:44,377.377 INFO:teuthology.suite.run:Test results viewable at
|
|
@perezjosibm thanks for the rerun. The 10-15 crimson-rados seastore run came back with no regressions after the infra failures on 10-12. @Matan-B your approval is from 10-06, before the 10-10 push that fixed tracker #81552. Since then the PR has three commits:
Could you re-approve against the current head ( |
|
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. |
RBM capacity management and stability fixes. #69275 and #69351, which this PR depended on, have merged; the branch is rebased onto current
main. Three commits:Deferred frees limited to the in-flight write (
crimson/seastore/rbm: defer only the in-flight write's extents on conflict): fixes a pre-existing bug onmain.RandomBlockOolWritersnapshots the wholepre_alloc_listand frees it through its own cleaner once the write completes (829c857).RBMCleanersince 223dde6), that list holds extents of both tiers. The other tier's extents go to a cleaner that does not own their device;RBMCleaner::mark_space_free()ignores them, and the space is never returned. Measured on unmodifiedmain: 6058 such frees (~258 MiB) in 300s under overwrite load. A SEGMENTED cache tier is not affected (only RBM extents are pre-allocated).ExtentPlacementManager::mark_space_free(), which routes by device id. Standalone, so it can be backported on its own.Capacity gating and reservation on the allocator view (
crimson/seastore/rbm: gate writes and space reserve on allocator state)stats.used_bytesdrifts from the block allocator under overwrites (unmetered paths such asalloc_paddr).get_free_blocks()now reports the AVL allocator's available size, andtry_reserve_projected_usage(),get_stat()(henceis_storage_full()and statfs) and therbm_cleanermetrics read that view.is_storage_full()stays as merged in crimson/osd: gate write ops at OSDOp boundary when local store is full #69351 and keeps trackingosd_failsafe_full_ratio; only its source of used bytes changes.OOL write leakage and backpressure (
crimson/seastore/rbm: fix leakage on conflicted OOL writes)t.pending_oolwas not cleared after a successful OOL write: a transaction conflicted after its write completed flippedis_conflictedon an already-completed handle and skipped the immediate free path, leaving extents allocated until the allocator was exhausted and the OSD deadlocked.pending_oolin thedo_write()completion continuation on every exit path and on transaction reset. Tracks the bytes of conflicted writes still in flight inRBMCleanerand applies backpressure when they exceed 5% of data capacity.mark_space_free(), so on a tiered store they land on the cleaner that later subtracts them. Fixes https://tracker.ceph.com/issues/81552 (ceph_assertinRBMCleaner::deaccount_conflict_pending_freeon tiered stores, found in QA of the previous revision).Testing
seastore_lbc_test_stress, 2Q cachepin,seastore_max_concurrent_transactions=8, concurrentrados benchoverwrites): the previous revision hit tracker #81552 within ~30s. With this revision the OSD stays up for 480s with a SEGMENTED cache tier (~12k invalidated transactions per 180s) and for 300s with a RANDOM_BLOCK cache tier.unittest-transaction-manager,unittest-seastoreandunittest-btree-lba-managerpass at each commit.