Skip to content

PublishBatchNoAck client side - #2478

Merged
thomaska merged 6 commits into
mainfrom
infoplat-19548-producenoack
Oct 26, 2026
Merged

thomaska merged 6 commits into
mainfrom
infoplat-19548-producenoack

Conversation

@thomaska

@thomaska thomaska commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

INFOPLAT-19548

What

  • New PublishBatchNoAck RPC (pb/chip_ingress.proto): same validation, partial-delivery / transaction_enabled semantics and positional results as PublishBatch, but the server produces to Kafka with acks=0 — success means validated and handed to the producer, not persisted. For loss-tolerant telemetry (OTI migration, INFOPLAT-19548).
  • Regenerated pb files with the pinned toolchain (protoc v5.29.3, protoc-gen-go v1.36.6, protoc-gen-go-grpc v1.6.2 — headers match existing).
  • client.PublishBatchNoAck passthrough + NoopClient.PublishBatchNoAck; mocks regenerated.
  • Tests: passthrough/error/noop; TestClient_PublishBatchNoAck_HeadersReachServer — pins that WithHeaderProvider metadata travels as HTTP/2 headers on the new RPC (the axis INFOPLAT-19544 routes on).

Why

  • OTI currently reaches acks=0 only via the hardcoded oti-telemetry-shared principal branch server-side. A typed RPC makes fire-and-forget an explicit per-request caller choice with a real error contract, so the principal special case can eventually be retired.

Testing

  1. go build ./...; go test ./... in pkg/chipingress (all pass); root module unaffected (pins the published pseudo-version).

Notes

  • Additive on the wire, but Client embeds pb.ChipIngressClient — external implementers must add the method (NoopClient + mocks updated here; NewClient users unaffected).
  • Deploy order: this merges first; chip-ingress bumps the pseudo-version in a follow-up atlas PR. Older servers return Unimplemented until then.
  • Deferred follow-up: batch.WithNoAck() for the shared batch client.

Copilot AI balanced review requested due to automatic review settings October 20, 2026 11:53
@thomaska
thomaska requested a review from a team as a code owner October 20, 2026 11:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions

Copy link
Copy Markdown
Contributor

👋 thomaska, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ API Diff Results - github.com/smartcontractkit/chainlink-common/pkg/chipingress

⚠️ Breaking Changes (2)

pb.ChipIngressClient (2)
  • PublishBatchNoAck — ➕ Added

  • PublishBatchNoAck — ➕ Added

✅ Compatible Changes (8)

NoopClient (1)
  • PublishBatchNoAck — ➕ Added
batch (1)
  • WithNoAck — ➕ Added
mocks (1)
  • Client_PublishBatchNoAck_Call — ➕ Added
mocks.(*Client) (1)
  • PublishBatchNoAck — ➕ Added
mocks.(*Client_Expecter) (1)
  • PublishBatchNoAck — ➕ Added
pb (1)
  • ChipIngress_PublishBatchNoAck_FullMethodName — ➕ Added
pb.ChipIngressServer (1)
  • PublishBatchNoAck — ➕ Added
pb.UnimplementedChipIngressServer (1)
  • PublishBatchNoAck — ➕ Added

📄 View full apidiff report

@thomaska thomaska changed the title 1st implementation PublishBatchNoAck client side Oct 20, 2026
Comment thread pkg/chipingress/client_test.go Outdated
Comment thread pkg/chipingress/client_test.go Outdated

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 4fbcc63 Previous: 7fdf8ba Ratio
BenchmarkKeystore_Sign/nop/in-process 854.9 ns/op 410 ns/op 2.09

This comment was automatically generated by workflow using github-action-benchmark.

@pkcll pkcll left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall: additive on the wire, generated code and mocks look right, tests pass locally (go test ./... -race in pkg/chipingress). A few non-blocking suggestions:

1. Make the response contract explicit in the proto comment. The intent is that NoAck only changes when the server responds, not what it responds with. Callers (and the upcoming batch.WithNoAck()) depend on that, since the batch client dispatches per-event callbacks by position and treats a short results slice as RESULTS_MISMATCH. Suggested wording:

// PublishBatchNoAck has the same request/response contract as PublishBatch: same
// validation, partial-delivery and transaction_enabled semantics, same positional
// results and PublishErrorCodes. The only difference is that the server produces to
// Kafka with acks=0 and responds without waiting for broker acknowledgement, so a
// success means validated and handed to the producer, not persisted, and broker-side
// produce failures are not reported. Servers that predate this RPC return UNIMPLEMENTED.
// Use only for loss-tolerant telemetry.

It would be good to hold the atlas handler to the same thing: return the full positional results, not an empty PublishResponse.

2. Retry docs. WithRetryPolicy is service-wide, so it now also retries PublishBatchNoAck. docs/retry-policy.md, the WithRetryPolicy godoc and the README "Retries" section list the replayed RPCs; worth adding the new one.

3. Heads-up for the bump. Client embeds pb.ChipIngressClient, so hand-written implementers stop compiling. One I found: noopChipIngressPublisher in chainlink core/services/synchronization/chip_ingress_batch_worker_test.go will need the new method when chainlink bumps pkg/chipingress.

4. batch.WithNoAck() follow-up: #2491. It only selects the RPC in sendBatch, so callbacks and error codes are unchanged, and adds a no_ack attribute to the send metrics only for NoAck clients, so NoAck hand-off latency doesn't skew chip_ingress.batch.request_latency_ms and existing series keep their labels. It depends on point 1: the batch client matches callbacks to results by position.

pkcll
pkcll previously approved these changes Oct 23, 2026
* chipingress/batch: add WithNoAck option

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.

* chipingress/batch: fix lint in WithNoAck tests

Use require for error assertions (testifylint) and drop a redundant
PublishErrorCode conversion (unconvert).
@thomaska
thomaska added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 8ed7b17 Oct 26, 2026
36 of 37 checks passed
@thomaska
thomaska deleted the infoplat-19548-producenoack branch October 26, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants