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


##########
server/src/main/java/org/apache/druid/metadata/SegmentsMetadataManagerConfig.java:
##########
@@ -39,14 +40,24 @@ public class SegmentsMetadataManagerConfig
   @JsonProperty
   private final SegmentMetadataCache.UsageMode useIncrementalCache;
 
+  @JsonProperty
+  private final UnusedSegmentKillerConfig killUnused;
+
   @JsonCreator
   public SegmentsMetadataManagerConfig(
       @JsonProperty("pollDuration") Period pollDuration,
-      @JsonProperty("useIncrementalCache") SegmentMetadataCache.UsageMode 
useIncrementalCache
+      @JsonProperty("useIncrementalCache") SegmentMetadataCache.UsageMode 
useIncrementalCache,
+      @JsonProperty("killUnused") UnusedSegmentKillerConfig killUnused
   )
   {
     this.pollDuration = Configs.valueOrDefault(pollDuration, 
Period.minutes(1));
     this.useIncrementalCache = Configs.valueOrDefault(useIncrementalCache, 
SegmentMetadataCache.UsageMode.NEVER);
+    this.killUnused = Configs.valueOrDefault(killUnused, new 
UnusedSegmentKillerConfig(null, null));
+    if (this.killUnused.isEnabled() && this.useIncrementalCache == 
SegmentMetadataCache.UsageMode.NEVER) {

Review Comment:
   Yes, config-based validation would not be possible as the two can be 
separate processes.
   The only validation we can do is not accept kill tasks submitted by the 
coordinator to the Overlord
   (they would have the prefix `coordinator-issued-kill`). It might feel a bit 
hacky but it's the cleanest
   option right now (short of exposing an API to read the config, which is 
overkill).
   
   Also, as @capistrant points out, there is no inherent harm in running the 
two kill modes together
   since each kill task (both embedded and normal) acquires an EXCLUSIVE lock 
on the interval.
   Embedded kill tasks don't take up a task slot, so that should not be a 
concern either.
   
   Also, users are always allowed to submit `kill` tasks manually. So several 
kill tasks for the same datasource
   can be running concurrently anyway.
   
   @capistrant , @abhishekrb19 , please let me know if we should add validation 
to not accept kill tasks submitted by the Coordinator if embedded kill is 
enabled.



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