You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "dajac (via GitHub)" <gi...@apache.org> on 2026/05/07 21:23:38 UTC
[PR] KAFKA-20444: [6/N] Handle GROUP_ID_NOT_FOUND and STALE_MEMBER_EPOCH in TransactionManager (KIP-1319) [kafka]
dajac opened a new pull request, #22239:
URL: https://github.com/apache/kafka/pull/22239
This patch updates `TxnOffsetCommitHandler` in `TransactionManager` to
handle the two new error codes alongside the existing
`ILLEGAL_GENERATION` and `UNKNOWN_MEMBER_ID` cases. All four are
treated as a consumer group metadata mismatch and abort the
transaction with a `CommitFailedException`, so behavior at v6+ is
identical to v0-5.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20444: [6/N] Handle GROUP_ID_NOT_FOUND and STALE_MEMBER_EPOCH in TransactionManager (KIP-1319) [kafka]
Posted by "squah-confluent (via GitHub)" <gi...@apache.org>.
squah-confluent commented on code in PR #22239:
URL: https://github.com/apache/kafka/pull/22239#discussion_r3214573643
##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/TransactionManagerTest.java:
##########
@@ -1260,6 +1260,32 @@ public void testIllegalGenerationInTxnOffsetCommitByGroupMetadata() {
assertAbortableError(CommitFailedException.class);
}
+ @ParameterizedTest
+ @EnumSource(value = Errors.class, names = {"GROUP_ID_NOT_FOUND", "STALE_MEMBER_EPOCH"})
+ public void testGroupMetadataMismatchErrorInTxnOffsetCommit(Errors error) {
+ // GROUP_ID_NOT_FOUND and STALE_MEMBER_EPOCH from TxnOffsetCommit (v6+)
+ // must abort the transaction with a CommitFailedException, matching the
+ // behavior for ILLEGAL_GENERATION returned by older broker versions.
+ final TopicPartition tp = new TopicPartition("foo", 0);
+
+ doInitTransactions();
+
+ transactionManager.beginTransaction();
+ TransactionalRequestResult sendOffsetsResult = transactionManager.sendOffsetsToTransaction(
+ Map.of(tp, new OffsetAndMetadata(39L)), new ConsumerGroupMetadata(consumerGroupId));
+
+ prepareAddOffsetsToTxnResponse(Errors.NONE, consumerGroupId, producerId, epoch);
+ prepareFindCoordinatorResponse(Errors.NONE, false, CoordinatorType.GROUP, consumerGroupId);
Review Comment:
Thanks, lgtm
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20444: [6/N] Handle GROUP_ID_NOT_FOUND and STALE_MEMBER_EPOCH in TransactionManager (KIP-1319) [kafka]
Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac merged PR #22239:
URL: https://github.com/apache/kafka/pull/22239
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20444: [6/N] Handle GROUP_ID_NOT_FOUND and STALE_MEMBER_EPOCH in TransactionManager (KIP-1319) [kafka]
Posted by "squah-confluent (via GitHub)" <gi...@apache.org>.
squah-confluent commented on code in PR #22239:
URL: https://github.com/apache/kafka/pull/22239#discussion_r3214186104
##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/TransactionManagerTest.java:
##########
@@ -1260,6 +1260,32 @@ public void testIllegalGenerationInTxnOffsetCommitByGroupMetadata() {
assertAbortableError(CommitFailedException.class);
}
+ @ParameterizedTest
+ @EnumSource(value = Errors.class, names = {"GROUP_ID_NOT_FOUND", "STALE_MEMBER_EPOCH"})
+ public void testGroupMetadataMismatchErrorInTxnOffsetCommit(Errors error) {
+ // GROUP_ID_NOT_FOUND and STALE_MEMBER_EPOCH from TxnOffsetCommit (v6+)
+ // must abort the transaction with a CommitFailedException, matching the
+ // behavior for ILLEGAL_GENERATION returned by older broker versions.
+ final TopicPartition tp = new TopicPartition("foo", 0);
+
+ doInitTransactions();
+
+ transactionManager.beginTransaction();
+ TransactionalRequestResult sendOffsetsResult = transactionManager.sendOffsetsToTransaction(
+ Map.of(tp, new OffsetAndMetadata(39L)), new ConsumerGroupMetadata(consumerGroupId));
+
+ prepareAddOffsetsToTxnResponse(Errors.NONE, consumerGroupId, producerId, epoch);
+ prepareFindCoordinatorResponse(Errors.NONE, false, CoordinatorType.GROUP, consumerGroupId);
Review Comment:
very minor nit: In the other two TxnOffsetCommit error tests above, we `runUntil(() -> transactionManager.coordinator(CoordinatorType.GROUP) != null);` and the line breaks around the last `runUntil` are different
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20444: [6/N] Handle GROUP_ID_NOT_FOUND and STALE_MEMBER_EPOCH in TransactionManager (KIP-1319) [kafka]
Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on code in PR #22239:
URL: https://github.com/apache/kafka/pull/22239#discussion_r3214501499
##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/TransactionManagerTest.java:
##########
@@ -1260,6 +1260,32 @@ public void testIllegalGenerationInTxnOffsetCommitByGroupMetadata() {
assertAbortableError(CommitFailedException.class);
}
+ @ParameterizedTest
+ @EnumSource(value = Errors.class, names = {"GROUP_ID_NOT_FOUND", "STALE_MEMBER_EPOCH"})
+ public void testGroupMetadataMismatchErrorInTxnOffsetCommit(Errors error) {
+ // GROUP_ID_NOT_FOUND and STALE_MEMBER_EPOCH from TxnOffsetCommit (v6+)
+ // must abort the transaction with a CommitFailedException, matching the
+ // behavior for ILLEGAL_GENERATION returned by older broker versions.
+ final TopicPartition tp = new TopicPartition("foo", 0);
+
+ doInitTransactions();
+
+ transactionManager.beginTransaction();
+ TransactionalRequestResult sendOffsetsResult = transactionManager.sendOffsetsToTransaction(
+ Map.of(tp, new OffsetAndMetadata(39L)), new ConsumerGroupMetadata(consumerGroupId));
+
+ prepareAddOffsetsToTxnResponse(Errors.NONE, consumerGroupId, producerId, epoch);
+ prepareFindCoordinatorResponse(Errors.NONE, false, CoordinatorType.GROUP, consumerGroupId);
Review Comment:
Updated the path to follow the same pattern.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org