Repository navigation
fix: hand a bundle round's uncaptured cells back to the per-cell path (#243) - #244
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
- A capture that refuses (`db.sync()`, `pos()`, a staged-row read) left its cell uncredited while `bucket_bundling()` stayed armed, and `sync_loop` uploads nothing per cell while bundling is armed, so that durability ticket waited out its whole budget with zero PUTs until another write arrived (#243). - The round now reports the incomplete capture, flushes and credits the cells it did capture, and only then drops bundling so the scan's worker retries the failed cell per cell with backoff. Dropping it first would clear the epoch, and `put_bundle` refuses a bucket flush without one: the healthy cells' rows would be discarded and nobody credited (#244 review). - A failed cell's rows are staged per cell and never extended into the bundle, so the per-cell retry uploads each row exactly once. A closed replica stays a silent skip: that cell has no credit path. - a_failed_bundle_capture_flushes_its_healthy_cells_first pins the whole contract deterministically: two tickets land under the cell map's lock so the round always sees both cells, a one-shot seam fails c0's capture, and the test asserts one bundle PUT with c1 credited by it and c0 credited by its own per-cell retry. Fail-before (stall noted before the flush) panics at the per-cell assertion.
ryuzdev
force-pushed
the
fix/bundle-capture-fallback
branch
from
November 24, 2026 09:37
2878d7f to
feda53b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The stall
Inside a bundle round, a capture can refuse:
db.sync()errors,db.pos()errors, or a staged-row
read_ltx_fileerrors. The cell was then dropped withbucket_bundling()still armed, andsync_loopuploads nothing per cell whilebundling is armed — bundling was dropped only on a
put_bundlefailure or afailed lone-cell
sync_cell. So with no later write, that durability ticketwaited out its whole
CELLO_LTX_DURABILITY_TIMEOUT_SECSbudget with zeroPUTs, and the cell reset. Same class as #200, different trigger.
The fix (round 2, after review)
The round reports an incomplete capture, and order matters:
bundle PUT and are credited.
note_bucket_bundle_stalled()after theif flushed_ok { … }block. Thatdrops the epoch so
sync_loopre-spawns a per-cell worker that retries withits existing 50 ms backoff.
credits.is_empty()early-continue path also notes the stall, becausethere is no flush to protect there.
Round 1 noted the stall before the flush. That clears
bucket_epoch, andput_bundlerefuses a bucket flush without a live epoch, so the whole roundissued no PUT and the healthy cells' captured rows were discarded — nobody was
credited. This was the P2 from review; the ordering is the fix.
No duplicate rows. A failed cell's rows are now staged into a per-cell
Vecinside the capture and extended intoentriesonly when the capture iscomplete, so the failed cell contributes nothing to the bundle. Its per-cell
retry uploads each row exactly once; a restore sees each row either as a
per-cell object or as a bundle row, never twice. Entries are otherwise identical
to before, which the existing
bundle_loop_shares_one_bundle_between_two_cellscase confirms (one shared bundle, no per-cell PUTs).
A closed replica is not a failure:
managed_db_mutreturningNonemeansthe cell is leaving and has no credit path at all, so it stays a silent skip.
No timeout bump, no sleep, no retry loop added.
Fail-before and the test
node_log::bucket_executor_tests::a_failed_bundle_capture_flushes_its_healthy_cells_firstis deterministic: both tickets are taken in one call
(
bump_durability_tickets_for_test) under the cell map's lock, which theloop's dirty snapshot also takes, so a round can never observe half the round's
tickets and always sees two dirty cells and the shared bundle path. A one-shot
#[cfg(test)]seam fails c0's capture, and the test awaits c0's own heldticket (
await_durability_ticket_for_test) so the retry sees a single pendingwrite and takes the per-cell path instead of a fresh ticket that would turn it
into a one-cell bundle.
Assertions, all non-timing:
log/n0/gen1/bundle/— the healthy cell's rowsride it, so the flush preceded the stall;
c0—the healthy cell was credited by the bundle, the failed one by the per-cell
retry;
ProofSource::Bucket;wait_for_bundle_stalls).Fail-before, on the reviewed ordering (stall noted before the flush):
panicked at the failed cell uploads through the per-cell path. With the fix:3/3 runs green in 0.01 s.
Checks
cargo test --profile ci --locked -p cello --no-fail-fast: 0test result: FAILEDlines (lib 629 passed, main 43, every conformancebinary). The other bundle cases
(
bundle_loop_shares_one_bundle_between_two_cells,lone_cell_per_cell_failure_heals_through_retry,a_posture_wake_is_spent_on_the_round_it_enables) pass.cargo clippy --profile ci --locked --all-targets -- -D warnings: clean.cargo fmt --check: clean.node scripts/check-docs.mjs: clean.## Unreleasedbullet updated with the flush-then-fallbackordering and the no-duplicate-rows property.
docs/reference/cloudflare-compat.mduntouched: no workerd surface change.Closes #243