jolshan commented on code in PR #17402:
URL: https://github.com/apache/kafka/pull/17402#discussion_r1819457688
##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/TransactionManagerTest.java:
##########
@@ -3108,15 +3180,25 @@ public void
testAbortTransactionAndResetSequenceNumberOnUnknownProducerId() thro
transactionManager.beginTransaction();
transactionManager.maybeAddPartition(tp0);
- prepareAddPartitionsToTxnResponse(Errors.NONE, tp0, epoch, producerId);
+ if (!transactionV2Enabled) {
+ prepareAddPartitionsToTxnResponse(Errors.NONE, tp0, epoch,
producerId);
+ } else {
+ prepareAddPartitionsToTxnResponse(Errors.NONE, tp0, (short) (epoch
+ 1), producerId);
+ }
runUntil(() -> transactionManager.isPartitionAdded(tp0));
assertEquals(0, transactionManager.sequenceNumber(tp0));
- assertEquals(1, transactionManager.sequenceNumber(tp1));
+
Review Comment:
nit: we don't necessarily need to change this test here, but it was
originally checking the sequence is reset on tp0 when it saw the error. Now we
will always start with sequence 0 after aborting, so the end result is not as
substantial. I think it is useful to go through the abort flow here though.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]