perf(server-ng): compute batch checksum in a single produce pass - #3746
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3746 +/- ##
=============================================
- Coverage 76.20% 63.65% -12.55%
Complexity 969 969
=============================================
Files 1325 1324 -1
Lines 163090 152239 -10851
Branches 135971 125197 -10774
=============================================
- Hits 124281 96907 -27374
- Misses 35123 51523 +16400
- Partials 3686 3809 +123
🚀 New features to boost your workflow:
|
hubcio
force-pushed
the
feat/server-ng-perf
branch
from
July 27, 2026 08:59
7bf57b2 to
3a944be
Compare
krishvishal
reviewed
Jul 28, 2026
krishvishal
reviewed
Jul 28, 2026
krishvishal
reviewed
Jul 28, 2026
Contributor
Author
|
@krishvishal tyvm for review, i think i will split this PR into 2 smaller PRs to make it more bearable for review. EDIT: done |
hubcio
force-pushed
the
feat/server-ng-perf
branch
from
August 3, 2026 09:04
3a944be to
a8832ce
Compare
hubcio
force-pushed
the
feat/server-ng-perf
branch
from
August 3, 2026 09:35
a8832ce to
e87f1e3
Compare
Produce hashed each batch three times: convert, stamp, and flush revalidation. The batch checksum is redefined to cover the six header meta fields plus each message's stored checksum field instead of the whole blob, binding bodies transitively through the per-message checksums every validating decode re-verifies. Stamping now hashes N*8 bytes instead of the full blob, and locally originated batches decode trusted; replicated blobs keep a per-message receive gate on followers, so transit integrity holds end to end. Message data written by earlier server-ng builds fails checksum validation after this change; wipe local_data when upgrading. Per-message checksums are computed in a single oneshot pass over the encoded record, pinned by a streaming-vs-oneshot reference test. A frame walk stops at the last decodable record, so bytes past batch_length no longer alter any checksum. Both ingest boundaries therefore require the frame to end exactly at batch_length: a SendMessages request or prepare whose size overshoots is now rejected rather than carrying the surplus to disk, where the flush would write it and the segment walk would step over it into junk.
hubcio
force-pushed
the
feat/server-ng-perf
branch
from
August 3, 2026 09:36
e87f1e3 to
b691d33
Compare
spetz
pushed a commit
that referenced
this pull request
Aug 4, 2026
…RU (#3806) A lone consumer crossing a sealed segment degraded to full-segment scans: rotation drops the writer and the resident index, so every poll re-opened the file and scanned from byte 0. Sealed segments now share a per-partition read-state handle caching the read fd and the sparse index reloaded from the .index file, capped by an LRU so descriptors stay bounded. Shard allocation defaults back to numa:auto now that multi-shard server-ng is stable; the previous single-shard default collapsed all work onto one core. This is half of the single-node latency parity work; the produce-side single-pass batch checksum change lives in #3746.
numinnex
approved these changes
Aug 4, 2026
mmodzelewski
approved these changes
Aug 4, 2026
spetz
approved these changes
Aug 4, 2026
krishvishal
approved these changes
Aug 4, 2026
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.
Produce hashed each batch three times: convert, stamp, and flush
revalidation. The batch checksum is redefined to cover the six header
meta fields plus each message's stored checksum field instead of the
whole blob, binding bodies transitively through the per-message
checksums every validating decode re-verifies. Stamping now hashes N*8
bytes instead of the full blob, and locally originated batches decode
trusted; replicated blobs keep a per-message receive gate on
followers, so transit integrity holds end to end.
Message data written by earlier server-ng builds fails checksum
validation after this change; wipe local_data when upgrading.
Per-message checksums are computed in a single oneshot pass over the
encoded record, pinned by a streaming-vs-oneshot reference test.
This is half of the single-node latency parity work; the consumer-side
sealed-segment read-handle LRU and the numa:auto shard-allocation
default were split out into a separate PR.