Skip to content

fix: move produce tagged fields inside partition loop#127

Open
klaudworks wants to merge 1 commit intoKafScale:mainfrom
klaudworks:fix/produce-tagged-fields
Open

fix: move produce tagged fields inside partition loop#127
klaudworks wants to merge 1 commit intoKafScale:mainfrom
klaudworks:fix/produce-tagged-fields

Conversation

@klaudworks
Copy link
Collaborator

@klaudworks klaudworks commented Mar 1, 2026

Merge #126 first, this pr is stacked on top. Closes #124.

Summary

  • Fix produce request parser and encoder placing partition-level tagged fields
    outside the inner partition loop — ran once per topic instead of once per
    partition. Multi-partition produces would generate/parse invalid wire format
    for flexible versions (v9+).
  • Add franz-go cross-compatibility test encoding and decoding multi-partition
    produce v9 requests in both directions.
  • Strengthen existing round-trip test to use 3+2 partitions across two topics.

@novatechflow
Copy link
Collaborator

@klaudworks - same here

ParseRequest and EncodeProduceRequest both placed the partition-level
tagged fields call outside the inner partition loop. With multiple
partitions per topic, the parser consumed only one tagged-field block
instead of one per partition, corrupting subsequent partition reads.
The encoder had a matching bug with a misleading comment claiming the
deviation was intentional.

Move SkipTaggedFields/WriteTaggedFields inside the for-partition loop
in both functions. Add multi-partition round-trip and franz-go cross-
compatibility tests that exercise the previously broken path.
@klaudworks klaudworks force-pushed the fix/produce-tagged-fields branch from 9d0da7b to 076ad62 Compare March 2, 2026 12:56
@klaudworks klaudworks requested a review from novatechflow March 2, 2026 13:13
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.

bug: produce request encoding breaks with multiple partitions per topic

2 participants