cecemei commented on code in PR #18950:
URL: https://github.com/apache/druid/pull/18950#discussion_r2760483015


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:
##########
@@ -440,8 +448,7 @@ public int getPriority()
   @Override
   public boolean isReady(TaskActionClient taskActionClient) throws Exception
   {
-    final List<DataSegment> segments = 
segmentProvider.findSegments(taskActionClient);
-    return determineLockGranularityAndTryLockWithSegments(taskActionClient, 
segments, segmentProvider::checkSegments);
+    return determineLockGranularityAndTryLock(taskActionClient, 
List.of(segmentProvider.interval));

Review Comment:
   ah i was thinking the case when the umbrella interval is smaller than the 
original interval (which is the case in CompactionTaskRunBase, the segment is 
hourly and there's only segments in hour 0 - hour 3, so compaction task only 
locks for 3 hours, but the interval can be all day (see 
NativeCompactionTaskRunTest). MSQ runner failed when getting a task lock with 
the following change:
   
   [diff.patch](https://github.com/user-attachments/files/25053997/diff.patch)
   
   > Cannot create a new taskLockPosse for 
request[TimeChunkLockRequest{lockType=REPLACE, 
groupId='compact_test_mgmlcmch_2026-02-03T18:37:51.661Z', dataSource='test', 
interval=2014-01-01T00:00:00.000Z/2014-01-02T00:00:00.000Z, 
preferredVersion='null', priority=25, revoked=false}] because existing 
locks[[TaskLockPosse{taskLock=TimeChunkLock{type=REPLACE, 
groupId='compact_test_mgmlcmch_2026-02-03T18:37:51.661Z', dataSource='test', 
interval=2014-01-01T00:00:00.000Z/2014-01-01T03:00:00.000Z, 
version='2026-02-03T18:37:51.673Z', priority=25, revoked=false}, 
taskIds=[compact_test_mgmlcmch_2026-02-03T18:37:51.661Z]}]] have same or higher 
priorities



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