kfaraz commented on code in PR #19091:
URL: https://github.com/apache/druid/pull/19091#discussion_r2907134139


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentTransactionalAppendAction.java:
##########
@@ -219,7 +219,30 @@ public SegmentPublishResult perform(Task task, 
TaskActionToolbox toolbox)
     }
 
     IndexTaskUtils.emitSegmentPublishMetrics(retVal, task, toolbox);
-    return retVal;
+
+    if (shouldFailImmediately(retVal, task, toolbox)) {
+      return SegmentPublishResult.fail(retVal.getErrorMsg());
+    } else {
+      return retVal;
+    }
+  }
+
+  /**
+   * Checks if the current publish action should be failed without allowing any
+   * more retries. A failed publish action should be retried only if there is
+   * another task waiting to publish offsets for an overlapping set of 
partitions.
+   */
+  private boolean shouldFailImmediately(SegmentPublishResult result, Task 
task, TaskActionToolbox toolbox)
+  {
+    if (result.isSuccess() || !result.isRetryable() || startMetadata == null) {

Review Comment:
   Do you mean the case where task B was launched with incorrect start offsets?
   
   Under normal conditions, start offsets of task B are the same as end offsets 
of task A (even if they have not been committed yet). This was addressed in the 
previous PR #19034 .
   
   Then if task B tries to commit before A, it will be asked to retry.
   If task B tries to commit after A, it will succeed since the metadata store 
has now been updated with end offsets of A.
   
   Please let me know if you were referring to some other case.



-- 
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]

Reply via email to