fix(bump-builder): chunk the bulk MINED fan-out to stay under Kafka MaxMessageBytes#221
Merged
Merged
Conversation
55a62ca to
0ca00b8
Compare
…axMessageBytes markMinedAndPublish coalesced a block's MINED fan-out into a single bulk event carrying every txid. A ~27k-tx block serialized to ~1.85 MB, over the 1 MiB default Producer.MaxMessageBytes, so PublishBulk failed and the MINED event was silently dropped for large blocks — the DB status was still MINED, but SSE/webhook subscribers never saw it. Split the txid list into <=maxTxIDsPerBulkEvent (5000) chunks, one event each (~340 KB), comfortably under the limit. Subscribers already unfan per-tx from TxIDs[], so multiple events per block are additive and harmless. (WS3a/WS3b from the original PR are dropped — superseded by #207's expected-STUMP recovery model.)
0ca00b8 to
e0b845e
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.
Context
markMinedAndPublishcoalesced a block's MINED fan-out into a single bulk event carrying every txid. A ~27k-tx block serialized to ~1.85 MB — over the 1 MiB defaultProducer.MaxMessageBytes— soPublishBulkfailed and the MINED event was silently dropped for large blocks: the DB status was stillMINED, but SSE/webhook subscribers never saw it.Change
Split the txid list into
<= maxTxIDsPerBulkEvent(5000) chunks, one event each (~340 KB), comfortably under the limit. Subscribers already unfan per-tx fromTxIDs[], so multiple events per block are additive and harmless.Notes
processed_atas the finalize/recovery signal +expectedSubtreeIndices). Rebased onto currentmain.builder_bulk_mined_test.go);go build/vet(incl. build tags),golangci-lint, and the bump_builder suite pass.