JNSimba commented on code in PR #113:
URL:
https://github.com/apache/doris-kafka-connector/pull/113#discussion_r4703485139
##########
src/main/java/org/apache/doris/kafka/connector/writer/load/AsyncDorisStreamLoad.java:
##########
@@ -204,18 +222,23 @@ public void run() {
// When the label is empty, it is the eof buffer for
checkpoint flush.
continue;
}
- load(buffer.getLabel(), buffer);
Review Comment:
Would this work? Since the semantics are "at least once" by design, we can
simply change the label when retrying.
```
String label = buffer.getLabel();
for (int retry = 0; retry <= maxRetries; retry++) {
try {
load(label, buffer);
return;
} catch (Exception e) {
if (retry == maxRetries) {
throw e;
}
LOG.warn("Stream load failed for label {}, will retry", label, e);
label = baseLabel + "_" + (retry + 1);
Thread.sleep(dorisOptions.getRetryIntervalMs());
}
}
```
--
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]