spuru9 commented on code in PR #338:
URL: 
https://github.com/apache/flink-connector-kafka/pull/338#discussion_r4718336530


##########
flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/sink/FlinkKafkaInternalProducerITCase.java:
##########
@@ -208,11 +208,10 @@ void testDoubleCommitAndAbort(boolean firstCommit, 
boolean secondCommit) {
                                     resumedProducer.abortTransaction();
                                 }
                             });
-            if (firstCommit == secondCommit) {
-                secondOp.doesNotThrowAnyException();
-            } else {
-                secondOp.isInstanceOf(InvalidTxnStateException.class);
-            }
+            // With Transactions V2 (KIP-890), the default since Kafka 4.0, 
ending a transaction
+            // bumps the producer epoch. A producer resumed with the epoch of 
the finished
+            // transaction is therefore fenced, whether it commits or aborts.
+            secondOp.isInstanceOf(ProducerFencedException.class);

Review Comment:
   Done. Old assertion restored; the test runs on TV1 only until FLINK-40689.



##########
flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/testutils/DockerImageVersions.java:
##########
@@ -24,8 +24,8 @@
  */
 public class DockerImageVersions {
 
-    public static final String CP_KAFKA = "confluentinc/cp-kafka:7.9.2";
-    public static final String APACHE_KAFKA = "apache/kafka:4.2.0";
+    public static final String CP_KAFKA = "confluentinc/cp-kafka:8.4.1";

Review Comment:
   Added. The sink transaction tests now also run on a TV1 broker.



##########
flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/sink/ExactlyOnceKafkaWriterITCase.java:
##########
@@ -208,6 +221,16 @@ private void triggerProducerException(KafkaWriter<Integer> 
writer, Properties pr
         writer.write(1, SINK_WRITER_CONTEXT);
     }
 
+    /**
+     * Waits until a record written after the first failure has failed too. 
With Transactions V2,

Review Comment:
   Right, reworded.



##########
flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/sink/KafkaTransactionLog.java:
##########
@@ -43,7 +43,10 @@
  */
 class KafkaTransactionLog {
 
-    private static final int SUPPORTED_KAFKA_SCHEMA_VERSION = 0;
+    private static final int MAX_KEY_SCHEMA_VERSION = 0;
+    // Brokers with Transactions V2 (KIP-890), the default since Kafka 4.0, 
write version 1. It

Review Comment:
   Fixed.



-- 
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]

Reply via email to