GWphua commented on code in PR #19016:
URL: https://github.com/apache/druid/pull/19016#discussion_r2958350614


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/NativeCompactionRunner.java:
##########
@@ -318,6 +370,11 @@ Map<String, Object> createContextForSubtask(CompactionTask 
compactionTask)
     newContext.putIfAbsent(CompactSegments.STORE_COMPACTION_STATE_KEY, 
STORE_COMPACTION_STATE);
     // Set the priority of the compaction task.
     newContext.put(Tasks.PRIORITY_KEY, compactionTask.getPriority());
+    // Native minor compaction uses REPLACE ingestion mode, which uses time 
chunk lock.
+    if (compactionTask.getIoConfig().getInputSpec() instanceof 
MinorCompactionInputSpec) {
+      newContext.put(Tasks.FORCE_TIME_CHUNK_LOCK_KEY, true);
+      newContext.put(Tasks.USE_CONCURRENT_LOCKS, true);

Review Comment:
   > locks would have already been acquired at this point.
   
   True, Compaction Tasks without useConcurrentLocks set to true will cause 
this error: 
   
   org.apache.druid.java.util.common.IOE: Error with status[500 Server Error] 
and message[{"error":"org.apache.druid.error.DruidException: Segments to 
upgrade must be covered by a REPLACE lock. Only [0] out of [454] segments are 
covered."}]. Check overlord logs for details.
   
   I will use a validator to return a better error message.



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