Skip to content

KAFKA-20444: [3/N] Allow building TxnOffsetCommit v6 requests with topic IDs (KIP-1319)#22215

Merged
dajac merged 1 commit intoapache:trunkfrom
dajac:KAFKA-20444-pr5a
May 6, 2026
Merged

KAFKA-20444: [3/N] Allow building TxnOffsetCommit v6 requests with topic IDs (KIP-1319)#22215
dajac merged 1 commit intoapache:trunkfrom
dajac:KAFKA-20444-pr5a

Conversation

@dajac
Copy link
Copy Markdown
Member

@dajac dajac commented May 5, 2026

This patch adds a forTopicIdsOrNames(...) factory to
TxnOffsetCommitRequest.Builder that allows building requests starting
from version 6 of the API. The existing forTopicNames(...) factory is
capped at version 5. build(short version) validates that the request
carries topic IDs starting from version 6 and topic names for versions 0
to 5. No call site uses the new factory yet — that lands in a follow-up
patch wiring up TransactionManager.

Reviewers: Sean Quah squah@confluent.io

…pic IDs (KIP-1319)

This patch adds a `forTopicIdsOrNames(...)` factory to
`TxnOffsetCommitRequest.Builder` that allows building requests
starting from version 6 of the API. The existing `forTopicNames(...)`
factory is capped at version 5. `build(short version)` validates that
the request carries topic IDs starting from version 6 and topic names
for versions 0 to 5. No call site uses the new factory yet — that
lands in a follow-up patch wiring up `TransactionManager`.
@dajac dajac requested a review from squah-confluent May 6, 2026 06:22
Copy link
Copy Markdown
Contributor

@squah-confluent squah-confluent left a comment

Choose a reason for hiding this comment

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

Thanks, lgtm.

The test coverage in TxnOffsetCommitRequestTest is a bit disjointed now.

Comment on lines +91 to +93
@ParameterizedTest
@ApiKeyVersionsSource(apiKey = ApiKeys.TXN_OFFSET_COMMIT, toVersion = 5)
public void testConstructor(short version) {
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.

It's weird that we now only test up to version 5 for some of these tests.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We can only test up to version 5 with topic names. I could perhaps update a few more... I will check separately.

@dajac dajac merged commit 2342c80 into apache:trunk May 6, 2026
25 checks passed
@dajac dajac deleted the KAFKA-20444-pr5a branch May 6, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants