Repository navigation
[DRAFT] Restore #40: populate LeaderEpoch, ProducerID, ProducerEpoch and Attrs on returned records - #109
Draft
koloss2001 wants to merge 1 commit into
Draft
[DRAFT] Restore #40: populate LeaderEpoch, ProducerID, ProducerEpoch and Attrs on returned records#109koloss2001 wants to merge 1 commit into
koloss2001 wants to merge 1 commit into
Conversation
…s on returned records (needs franz-go >= v1.22.0)
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.
This restores #40, which was reverted in #108. #40 requires franz-go >= v1.22.0 (for
kgo.NewRecordAttrs), and v1.22.x has known issues, so we pinned back to v1.21.6 to keepmainandrelease-0.1identical.This PR must stay in draft and cannot be merged until the franz-go v1.22.x issues are resolved and we're cleared to move to franz-go >= v1.22.0. When that happens, rebase onto
mainand re-resolvego.mod,go.sumandvendor/, since the deps will have moved by then. The rest of the diff is exactly #108 reverted.Original description (#40)
Makes the returned
*kgo.Recorda closer drop-in for franz-go by populating the produce-result metadata it currently leaves at zero.LeaderEpoch,ProducerID,ProducerEpoch→-1on every completion. This client is always a non-idempotent, non-transactional producer, and the broker returns no leader epoch on produce — exactly what franz-go reports in that mode.Attrs→ the batch's compression type +CreateTime, on partitions that succeed (matching franz-go, which setsAttrsonly on success).Parity is enforced by tests that run each scenario against both this client and a real non-idempotent franz-go client and assert identical record fields.
Offsetis intentionally left out of scope: it will be addressed separately.Attrsneedskgo.NewRecordAttrs, added upstream in twmb/franz-go#1369, now released in v1.22.0. The temporary replace has been dropped and go.mod bumped to v1.22.0.