AmatyaAvadhanula commented on code in PR #14995:
URL: https://github.com/apache/druid/pull/14995#discussion_r1387661968


##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:
##########
@@ -793,13 +793,17 @@ public void onFailure(Throwable t)
         status = Status.PUBLISHING;
       }
 
+      // The callback for a successful segment publish may remove a sequence 
from the publishingSequences,
+      // which is racy and can allow the same sequence to be added to the set 
again.
+      // Create a copy of publishing sequences to which we can only add 
elements, and not remove them.
+      final Set<String> publishingSequencesSnapshot = new 
HashSet<>(publishingSequences);

Review Comment:
   > Also, I wonder if there can still be duplicates as it really depends on 
the timing of snapshotting publishingSequences. Would a better solution be to 
track publishedSequences?
   
   I think that this may not happen since the removal happens from sequences 
and then from publishingSequences, so this order may help. Although it doesn't 
seem ideal.
   
   Thanks, I'll try to track publishedSequences instead.



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