Repository navigation
Support idempotent producers and committed reads - #432
PaxMachinaOne merged 3 commits into
Conversation
PaxMachinaOne
left a comment
There was a problem hiding this comment.
Two findings remain on this exact head:
-
High — the transaction isolation gate breaks the existing librdkafka consume path on both broker and proxy. The hosted
Go Integration Tests (kafka)check fails for the ordinarykcat -C ... -o beginningflow: its logical-END offset lookup receivesBroker: API version not supportedfor both targets. The new pre-routing gate inpkg/protocol/unsupported_transactions.go:65-78returnsUNSUPPORTED_VERSIONfor anyListOffsetsisolation value other than exactly zero; this now rejects the request emitted by the supported CI client before the existing ListOffsets handler runs. Restrict the rejection to an actualread_committedrequest (and handle versions without that field correctly), then add the exact librdkafka regression. -
Medium — deduplicated retries inflate
kafscale_produce_rps.AppendIdempotentBatchesreturns the original offsets for a duplicate without appending, butcmd/broker/main.go:1309-1312unconditionally adds every successful response batch toproducedMessages. Retried idempotent batches therefore count as fresh ingest, making the documented broker ingest-throughput metric spike during retry incidents. Carry an appended-vs-duplicate result (or equivalent) and count only newly persisted messages; add a retry metric regression.
The focused idempotent producer, allocator, protocol, broker, proxy, and storage tests pass under -race. The broader local metadata race suite also hit the pre-existing timing-sensitive TestNonstopHeartbeatRaceEndsAtDeadline; the PR-specific tests passed. Hosted CodeQL and all other completed checks are green, but the Kafka integration check is red as described above.
PaxMachinaOne
left a comment
There was a problem hiding this comment.
Re-reviewed the updated exact head. The prior blockers are fixed: ordinary librdkafka ListOffsets/FETCH paths now support both isolation modes for non-transactional records, while committed reads are fenced at the captured durable offset; deduplicated idempotent retries no longer increment produce-throughput metrics. The added restore rejection for transactional/control batches, volatile-tail handling, concurrent flush boundary, proxy parity, and recovery regressions are coherent. Focused and full storage/protocol/broker/proxy race suites pass, the hosted Kafka integration is green, and all completed hosted checks are green. No material findings.
Summary
Default Java producers fail before their first message because KafScale does not advertise
InitProducerId. Support nontransactional idempotence and committed reads in both brokers and the Kubernetes proxy, so default clients can produce withoutenable.idempotence=false.kafscale_produce_rps; deduplicated retries preserve offsets without inflating ingest throughput.Testing
-racethrough broker and proxy, including committed watermark queries and Fetch v4/v9/v13 in both isolation modes.go test -race ./pkg/storage ./pkg/metadata ./pkg/protocol ./pkg/broker ./cmd/broker ./cmd/proxypassed.go test ./test/...passed, including chart and repository checks.go vet ./...andpython3 hack/check_license_headers.pypassed.Limits: retry deduplication is scoped to the same producer session and recent batch window. Mixed duplicate/new multi-batch record sets are rejected before append. Transactional writes, coordinators, commit markers and cross-session exactly-once delivery remain unsupported. Restore refuses legacy transaction/control batches instead of exposing unverified transaction history.
Checklist
Closes #28.