JNSimba commented on code in PR #115:
URL:
https://github.com/apache/doris-kafka-connector/pull/115#discussion_r4677347242
##########
src/main/java/org/apache/doris/kafka/connector/writer/DorisWriter.java:
##########
@@ -121,9 +121,13 @@ protected void initRecord(final SinkRecord record) {
}
protected void insertRecord(final SinkRecord record) {
- // discard the record if the record offset is smaller or equal to
server side offset
+ // discard the record if the record offset is smaller or equal to
server side offset.
+ // a record at or below the buffer's last offset is already buffered
(a failed flush
+ // keeps its records in the buffer; Kafka Connect redelivers the
failed put() batch),
+ // so it must not be buffered a second time.
if (record.kafkaOffset() > this.offsetPersistedInDoris.get()
- && record.kafkaOffset() > processedOffset.get()) {
+ && record.kafkaOffset() > processedOffset.get()
+ && (buffer.isEmpty() || record.kafkaOffset() >
buffer.getLastOffset())) {
Review Comment:
https://github.com/apache/doris-kafka-connector/pull/113 If the retry
strategy is modified here, would this issue be resolved?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]