Repository navigation
perf(partitions): keep shard traffic moving during file I/O - #4311
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4311 +/- ##
============================================
+ Coverage 87.54% 88.49% +0.94%
+ Complexity 1608 1607 -1
============================================
Files 1300 1302 +2
Lines 241253 251971 +10718
Branches 201557 212268 +10711
============================================
+ Hits 211207 222981 +11774
+ Misses 25014 23629 -1385
- Partials 5032 5361 +329
🚀 New features to boost your workflow:
|
c2065e3 to
14500cd
Compare
|
/skill team-review-slim |
There was a problem hiding this comment.
Summary: No correctness or data-loss defect: three warnings cover a missing wake in the partition I/O drain, a whole-queue scan on every ready pop, and a 256 MiB default that can never apply because one job's charge exceeds 4 GiB, plus five nits and four simplifications. Merge of four expert passes (storage, perf, distsys, ecosystem) with every anchor re-checked against the checkout.
Counts: critical 0, warning 3, nit 5, simplification 4
Findings without an anchor on a changed line:
core/partitions/src/iggy_partition.rs:4977nit: New public I/O entry points such ashistory_is_busy,notify_ioandhas_io_dispatchercarry no doc comments, and the shard branches on their contracts. Add a one-line contract to each.
This review was generated by Claude Code 2.1.284 on deepseek-flash[1m]. Review the output before you act on it.
1357156 to
c30e383
Compare
|
don't merge or check this PR, it's way too convoluted right now. |
c30e383 to
fb661ff
Compare
|
/skill team-review-slim |
There was a problem hiding this comment.
Summary: Small findings only: a duplicated PartitionIoLimits conversion, an eager offset-file sync on a failed write, a dropped view message, and two doc gaps. The one performance warning about a capture-refusal spin was dropped after tracing showed the owner pump cannot build a capture plan while any file job is in flight, because resume_io returns Pending on io_active and only settle releases the gate.
Counts: critical 0, warning 0, nit 4, simplification 1
Findings without an anchor on a changed line:
core/partitions/src/iggy_partition.rs:5296nit:defer_view_transitiondrops the incoming view message when the slot holds another transition, because only theViewand empty arms store it. Document that retransmission recovers the round, or keep the newest message.
This review was generated by Claude Code 2.1.284 on deepseek-flash[1m]. Review the output before you act on it.
302cc4d to
50295e3
Compare
Partition file writes and durability barriers held the shard pump. Unrelated partitions waited until storage completed, and Replicated commits also waited for the WAL writer and its checkpoints. On a 3-node cluster, Replicated p999 rose from 2-6 ms to 21-140 ms. Run bounded, owned file jobs on the existing runtime and return results to the pump for identity checks and ordered publication. Commit, NoAck, purge, checkpoint and lifecycle continuations stay with their owners, so durability and reply ordering hold. A Replicated commit may pass a body the WAL writer has not written yet, up to a 16 MiB backlog, and its flush takes only the written prefix. Persisted commits wait while a WAL checkpoint is pending. So do offset writes, because the checkpoint syncs the offset files it lists. A session retirement follows partition durability. Shutdown stops originating prepares, answers queued requests and flushes committed ops. Each partition, a fatal one too, publishes its WAL frontier before the drain. The tick now runs between job phases, so it no longer extends the offset reservation during shutdown or certifies the WAL during an install. A state transfer pins its plan, so commits between rounds do not restart the build. A receiver refuses only snapshots behind an op it committed. Offset writes admitted before a purge get the terminal errors of #4325. Replicated p999 is back near master: 5.3 ms for 20 pinned producers, 2.7 ms for one, 6.6 ms for producing consumers and 4.2 ms for balanced producers. Add controlled I/O regressions for progress, capacity, stale completions, lifecycle transitions, purge, shutdown, transfers and Replicated run-ahead.
Failed purges could leave partially reset history serviceable, and state transfer could reclaim the replacement receipt checkpoint. File-job saturation also delayed unrelated replies, while shutdown could wait beyond the WAL head. Fence purge durability failures, cancel obsolete maintenance and persist retirement barriers. Keep reply continuations runnable under file-job saturation and validate commit headers in one journal pass. Use local completion delivery, account for cleanup allocations and align byte-limit configuration with other size settings. Add recovery regressions and remove obsolete helpers.
No test failed when a dispatched Replicated commit ignored a due checkpoint, or when a checkpoint covered a body that the WAL writer did not write yet. Two tests hold the writer and check both waits.
Server test futures exceed Clippy's size limit on macOS arm64. Pin the five affected futures on the heap without changing production code or test behavior.
The offset-history fixture exceeds macOS Clippy's future size limit. Box its nine test call sites without changing production execution.
Deferring repair replies as view transitions discarded valid prepares while partition file jobs were busy, creating new gaps after repair. Keep the existing repair completion barrier and check reply sessions without fencing live replication. Cover held I/O and stale nonces.
Coalesced reference-WAL flushes left large gaps in the sparse index, forcing each disk poll to scan an old prefix again. Bound index spans to the existing 1 MiB save size, preserving body writes and durability barriers. Cover backlog polling and checkpoint recovery.
Synchronous filesystem calls in metadata checkpoints, partition recovery and statistics can stall every task on a shard. Use Compio I/O and the bounded filesystem worker, retain cancellation ordering, cache statistics and transfer offers, and sync dirty offset directories. Preserve task-per-partition jobs and recovery barriers. Capture metadata replay protection after snapshot I/O so concurrent commits retain their sessions. Extend the regression to cover a transferred table ahead of the local applied frontier. (cherry picked from commit 202aefd9a28f551681cb0e3119851d2ac96a5559)
Compio snapshot I/O panics under the deterministic simulator executor. Select synchronous snapshot I/O for simulator replicas while sharing the durability sequence and retaining Compio for production. Cover checkpoint replay with a deterministic schedule regression.
Dispatch could bypass durability holds, retain obsolete shutdown intents, and finish purges with surviving bookmarks. Fence these transitions, detach teardown handles from partition storage, and preserve waiter order and reply batching. Add regressions covering checkpoint and transfer holds, offset admission, and purge recovery.
Rust 1.99 flags empty-value assertions and overflows the default test stack while constructing a large recovery fixture. Use diagnostic assertions and heap-allocate the fixture's partition values without changing the production path or increasing the test stack limit.
Pre-purge maintenance could delete new messages, and stalled file jobs could keep the primary alive without making progress. Clear obsolete retention, reject history-changed deletes and fence jobs at the existing 30-second drain limit. Keep independent consumer keys concurrent while retaining ordering, batch offset writes and renames, publish replies in the commit turn, and separate retries from ready completions. Index resident headers and amortize eviction to avoid repeated scans and tail rebuilds. Preserve offsets through failed install scans, use per-shard bounded filesystem workers and retain deferred view messages per sender. Leave transfer file jobs for a separate feature tracked by a TODO.
50295e3 to
c8b371b
Compare
The new server error 3014 left the Swift error table incomplete and failed the golden-vector CI check. Add its Swift mapping and refresh the generated fixture.
Truncation retained stale header positions and could select the wrong checksum during repair. Clear the index before replaying retained entries and cover out-of-order repair plus duplicate operations.
An interrupted file job could leave its shutdown owner asleep until the drain timed out. Notify the fenced owner without releasing its held resources, and avoid rescanning owners while file jobs remain.
Go, Node and Java did not recognize the history-change error returned by stale DeleteSegments requests. Add code 3014 to their existing tables and pin its metadata result mapping with regression tests.
Interrupted file work could skip the WAL drain or its retries, and late transfer and reconcile work could enter shutdown. Failed batches and installs also left recovery state incomplete. Drain accepted work with resources retained, close shutdown admission, and preserve history and cleanup continuations. Cover stale views, transfer retries, batch failures and retention. Expose lane limits and fence counters, and record broader I/O follow-ups without changing batching or deadline policy.
A partition could resolve segment offsets before applying an already committed purge and turn a temporary lag into error 3014. Compare owner history with metadata captured before the read. Keep the committed history guard for purges after resolution, including no-ops. Return HTTP 409 and document a fresh request instead of replaying the committed rejection.
Continuing after sampler thread creation failed served the initial system statistics forever. Propagate the failure before starting shards so a running server always has the background sampler.
Partition file writes and durability barriers held the shard pump,
delaying unrelated partitions until storage completed.
Run bounded, owned file jobs on the existing runtime and return
results to the pump for identity checks and ordered publication.
Keep commit, NoAck and lifecycle continuations with their owners.
Reserve job slots and retained bytes through result acceptance,
reuse consumer-offset descriptors and let replies progress when
file-job capacity is full. Drain outstanding work before repair,
transfer, purge, quarantine or shutdown.
Fence failed purge barriers, cancel obsolete checkpoint and retention
work before replacing history, and persist retirement barriers before
acknowledgment. Bound shutdown flushing by the WAL head, validate
commit headers in one pass and deliver completions locally.
Cover progress, capacity, stale completions, recovery and durability
failures with controlled I/O regressions and simulator purge tests.