stinger1206 commented on code in PR #113:
URL:
https://github.com/apache/doris-kafka-connector/pull/113#discussion_r4710318181
##########
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:
Updated in 350eb80 — each retry now uses a distinct label derived from the
original, with the existing retry configuration and backend reselection. Long
labels are handled within Doris' default label length limit.
##########
src/main/java/org/apache/doris/kafka/connector/writer/load/AsyncDorisStreamLoad.java:
##########
@@ -263,13 +348,29 @@ public void load(String label, RecordBuffer buffer)
throws IOException {
if (respContent == null || respContent.getMessage() ==
null) {
throw new StreamLoadException("response error : " +
loadResult);
}
- if
(!DORIS_SUCCESS_STATUS.contains(respContent.getStatus())) {
+ boolean confirmedFinishedDuplicate =
+
LABEL_ALREADY_EXISTS_STATUS.equals(respContent.getStatus())
+ && EXISTING_JOB_STATUS_FINISHED.equals(
+ respContent.getExistingJobStatus())
+ && label != null
+ && label.equals(respContent.getLabel());
+ if (!DORIS_SUCCESS_STATUS.contains(respContent.getStatus())
+ && !confirmedFinishedDuplicate) {
+ // a duplicate-label rejection without a FINISHED
existing job is
+ // ambiguous: the existing load may still be running
or may have
+ // failed, so it keeps failing until it resolves or
retries end
Review Comment:
Removed in 350eb80.
##########
src/main/java/org/apache/doris/kafka/connector/writer/load/AsyncDorisStreamLoad.java:
##########
@@ -73,6 +79,12 @@ public class AsyncDorisStreamLoad extends DataLoad {
private final AtomicBoolean started;
private volatile boolean loadThreadAlive = false;
private AtomicReference<Throwable> exception = new AtomicReference<>(null);
+ // Set for the lifetime of this object once a load failed and its retries
were exhausted:
+ // the failed buffer is dropped and the records it held can only be
recovered by replaying
+ // from the last committed Kafka offsets (task restart). start() restarts
the executor
+ // thread but must not clear this latch, otherwise later commits could
advance offsets
+ // past the records that were dropped by the failed load.
+ private final AtomicBoolean loadFailed = new AtomicBoolean(false);
Review Comment:
Updated in 350eb80 — `start()` no longer resets the exception, and the
separate `loadFailed` flag has been removed.
--
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]