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


##########
server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:
##########
@@ -997,20 +1016,53 @@ public int markNonOvershadowedSegmentsAsUsed(
     return markNonOvershadowedSegmentsAsUsed(unusedSegments, timeline, 
updateTime);
   }
 
-  private List<DataSegment> retrieveUnusedSegments(
+  /**
+   * Checks that all the segments were last updated within the kill buffer 
period.
+   * If any segment was updated earlier than that, an exception is thrown so 
that
+   * none of the segments are updated to ensure atomicity.
+   */
+  private void validateSegmentsForMarkingAsUsed(Collection<DataSegmentPlus> 
segments)
+  {
+    if (!managerConfig.getKillUnused().isEnabled()) {
+      // Do not verify the buffer period if embedded kill tasks are not enabled
+      return;
+    }

Review Comment:
   Yeah, I started with that. But then I realized that the `bufferPeriod` 
config makes sense only when embedded kill is enabled, since the 
`UnusedSegmentKillerConfig.bufferPeriod` does not apply to regular kill tasks.



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