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


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentAllocationQueue.java:
##########
@@ -183,19 +205,25 @@ private void processBatchesDue()
   {
     // If not leader, clear the queue and do not schedule any more rounds of 
processing
     if (!leaderSelector.isLeader()) {
-      log.info("Not leader anymore. Clearing [%d] batches from queue.", 
processingQueue.size());
-      processingQueue.clear();
+      log.info("Not leader anymore. Failing [%d] batches in queue.", 
processingQueue.size());
+
+      AllocateRequestBatch nextBatch = processingQueue.pollFirst();
+      while (nextBatch != null) {
+        nextBatch.markCompleted();

Review Comment:
   Done.



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