slachiewicz commented on code in PR #314:
URL:
https://github.com/apache/flink-connector-kafka/pull/314#discussion_r4800892385
##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/KafkaWriterStateSerializer.java:
##########
@@ -31,11 +31,17 @@
import static org.apache.flink.connector.kafka.sink.KafkaWriterState.UNKNOWN;
-/** A serializer used to serialize {@link KafkaWriterState}. */
+/**
+ * A serializer used to serialize {@link KafkaWriterState}.
+ *
+ * <p>Version 3 adds the producer id and epoch of every precommitted
transaction, so that a recovery
+ * can tell a transaction the committer still has to commit from a later
transaction that reused the
+ * same transactional id. State written by version 2 is read with unknown
producer id and epoch.
+ */
class KafkaWriterStateSerializer implements
SimpleVersionedSerializer<KafkaWriterState> {
@Override
public int getVersion() {
- return 2;
+ return 3;
Review Comment:
Yes. The FLINK-40626 release note now says every exactly-once sink,
`INCREMENTING` included, writes version 3, which 5.1.0 and earlier cannot
restore, so a rollback needs a savepoint taken with the older version. The PR
description says the same.
##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/internal/TransactionAbortStrategyImpl.java:
##########
@@ -205,6 +214,22 @@ public interface Context {
*/
Set<String> getPrecommittedTransactionalIds();
+ /**
+ * Returns whether the broker reported a later, still ongoing
transaction under the given
+ * transactional id than the precommitted one, opened under a newer
producer epoch after the
+ * id was reused. The precommitted transaction is then already
committed or aborted, and the
+ * committer's commit of it will be fenced. Returns {@code false} when
the state did not
Review Comment:
Opened [FLINK-41828](https://issues.apache.org/jira/browse/FLINK-41828) for
the committer's handling of `INVALID_PRODUCER_ID_MAPPING`. The javadoc, the
strategy comment and the warning no longer say the commit is fenced; they say
the committer cannot commit it. `1aa629ee`.
--
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]