Skip to content

[DRAFT] Restore #40: populate LeaderEpoch, ProducerID, ProducerEpoch and Attrs on returned records - #109

Draft
koloss2001 wants to merge 1 commit into
mainfrom
koloss2001/restore-pr40-franz-go-1.22
Draft

koloss2001 wants to merge 1 commit into
mainfrom
koloss2001/restore-pr40-franz-go-1.22

Conversation

@koloss2001

Copy link
Copy Markdown
Contributor

⚠️ Restoration of #40 — do not merge yet

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 keep main and release-0.1 identical.

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 main and re-resolve go.mod, go.sum and vendor/, since the deps will have moved by then. The rest of the diff is exactly #108 reverted.

Original description (#40)

Makes the returned *kgo.Record a closer drop-in for franz-go by populating the produce-result metadata it currently leaves at zero.

  • LeaderEpoch, ProducerID, ProducerEpoch → -1 on 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 sets Attrs only 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.

Offset is intentionally left out of scope: it will be addressed separately.

Attrs needs kgo.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.

…s on returned records (needs franz-go >= v1.22.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant