Skip to content

Place ack seqs through their allocator - #265

Merged
serprex merged 1 commit into
mainfrom
split/ack-allocator
Oct 23, 2026
Merged

serprex merged 1 commit into
mainfrom
split/ack-allocator

Conversation

@serprex

@serprex serprex commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Every OpenSeq clones and drops collector channel sender to publish placement. Route placement through SeqAlloc, which already owns sender and batches events. Preserve sequence ordering and collector shutdown.

Extracted from original #228 and based directly on main. Contains no changes from #226 or other extracted PRs.

Validation: cargo fmt --all -- --check, cargo clippy --workspace --all-targets --locked -- -D warnings, and cargo test --locked --lib emit::pipeline:: (77 passed). Rebuild crate for each isolated diff.

Measured impact (2026-10-22)

Compared 88e858c987e9b79f6f9ed40942296516ebec0db0 against shared parent 151fd47cbd75ec7b9bc63ffe7040f049e702ecd0, with each PR built separately.

Workload Base (ns/seq) PR (ns/seq) Median change
Immediate registration and placement 344.79 [337.09, 349.09] 326.15 [321.46, 345.72] -5.4%
Held events, flushed every 512 seqs 80.92 [80.05, 81.56] 74.49 [73.94, 74.64] -8.0%

Workload: 524,288 production SeqAlloc::open/place pairs with zero rows, real ack collector, yield every 4,096 seqs. Wait for contiguous collector frontier before stopping timer and check fatal state. Both revisions use SeqAlloc::place, isolating removed sender clones. Covers allocator/collector CPU, without row encoding, ClickHouse insertion, or bootstrap throughput.

AMD Ryzen 7 7840U; rustc 1.99.1; locked dependencies; optimized release builds; mimalloc 0.1.52. Seven trials per revision, alternating base/PR order, pinned to CPUs 2,4,6 (three physical cores). Values show median [min, max]; negative time changes mean less work or waiting. Local component measurements, without PostgreSQL or ClickHouse services.

Every OpenSeq cloned the collector's UnboundedSender to send its own
Placed event. The reorder allocator holds events and sends them in
bulk, so the clone and drop were pure refcount traffic on a channel
counter shared with the collector, about 6% of the serial queue
worker's cycles on the lifecycle benchmark.

SeqAlloc::place now sends or holds the event, and OpenSeq carries only
its seq. Tests that close the tail drop their allocator first, since
the collector exits once its last sender is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@serprex
serprex force-pushed the split/ack-allocator branch from 3f811d2 to d1b7c2f Compare October 22, 2026 20:38
@serprex
serprex merged commit 8cf4fd1 into main Oct 23, 2026
6 checks passed
@serprex
serprex deleted the split/ack-allocator branch October 23, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants