You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "tweise (via GitHub)" <gi...@apache.org> on 2024/07/04 16:56:05 UTC
Re: [PR] [FLINK-33545][Connectors/Kafka] KafkaSink implementation can cause dataloss during broker issue when not using EXACTLY_ONCE if there's any batching [flink-connector-kafka]
tweise commented on code in PR #70:
URL: https://github.com/apache/flink-connector-kafka/pull/70#discussion_r1665918661
##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/FlinkKafkaInternalProducer.java:
##########
@@ -396,8 +408,27 @@ public String toString() {
+ transactionalId
+ "', inTransaction="
+ inTransaction
+ + ", pendingRecords="
+ + pendingRecords.get()
+ ", closed="
+ closed
+ '}';
}
+
+ public class TrackingCallback implements Callback {
+
+ private final Callback actualCallback;
+
+ public TrackingCallback(final Callback actualCallback) {
+ this.actualCallback = actualCallback;
+ }
+
+ @Override
+ public void onCompletion(final RecordMetadata recordMetadata, final Exception e) {
+ pendingRecords.decrementAndGet();
Review Comment:
Since it already happened, we should probably decrement as soon as possible?
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org