Repository navigation
chipingress/batch: add WithNoAck option - #2491
Merged
Merged
Conversation
Contributor
✅ API Diff Results -
|
Add batch.WithNoAck(), which makes the batch client send batches with PublishBatchNoAck instead of PublishBatch. The option only selects the RPC: batching, splitting, timeouts, per-event results and error codes are unchanged. A nil callback error means the server validated the event and handed it to its producer, not that it was persisted. Servers that predate PublishBatchNoAck fail the batch with Unimplemented; there is no fallback to PublishBatch. NoAck clients tag send_requests_total, request_latency_ms and config.info with no_ack=true. The attribute is omitted for acked clients so their existing series keep their label set.
pkcll
force-pushed
the
chipingress-batch-with-noack
branch
from
October 22, 2026 21:02
9c0b069 to
669bab1
Compare
Use require for error assertions (testifylint) and drop a redundant PublishErrorCode conversion (unconvert).
pkcll
marked this pull request as ready for review
October 23, 2026 04:36
product-security-plaid-production
Bot
requested review from
4of9,
engnke,
fouadkada,
kirqz23,
skippaDaBitFlippa and
thomaska
October 23, 2026 04:36
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.
INFOPLAT-19548
Stacked on #2478 (base is that PR's branch; review only the last commit). Will retarget to
mainonce #2478 merges.What
batch.WithNoAck(): makes the batch client send batches withPublishBatchNoAck(server-side Kafkaacks=0) instead ofPublishBatch. This is the deferred follow-up listed in PublishBatchNoAck client side #2478.maxPublishTimeout, thePublishOptionson the request, positional per-event results andPublishErrorcodes are unchanged, so callbacks behave exactly as withPublishBatch. A nil callback error means the server validated the event and handed it to its producer, not that it was persisted (documented on the option).send_requests_total,request_latency_msandconfig.infowithno_ack=true, so hand-off latency is not mixed into acked latency. The attribute is omitted for acked clients, so existing series keep their label set. The four metric descriptions that said "PublishBatch" now say "Batch publish".Why
batch.Clientis the shared buffering client and always called ackedPublishBatch, so loss-tolerant callers (OTI migration) could not use the new RPC through it.Testing
cd pkg/chipingress && go test ./... -race -count=3(pass).batch/client_noack_test.go: routing (NoAck never callsPublishBatchand the reverse for the default), identical request incl.transaction_enabled, per-event results by position with the same error codes, result-count mismatch still reported, transport error /Unimplementedfails every callback with no fallback, size-based split issues multiplePublishBatchNoAckcalls, andno_ackpresent only for NoAck clients.no_ack=falsefor acked clients, fails the new tests.Notes
resultsasPublishBatchforPublishBatchNoAck(the PublishBatchNoAck client side #2478 proto contract). An empty response would surface asRESULTS_MISMATCHon every event; that is deliberately not worked around client-side.PublishBatchonUnimplemented: servers that predate the RPC fail the batch with the existing error log andsend_requests_total{status="failure"}. Roll the server out first.WithNoAckcan be combined withWithTransactionEnabled(true)client-side; what all-or-nothing means underacks=0is a server-side definition not covered here.