abhishekrb19 commented on code in PR #16362:
URL: https://github.com/apache/druid/pull/16362#discussion_r1586959462
##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/KillUnusedSegmentsTask.java:
##########
@@ -346,4 +347,24 @@ public LookupLoadingSpec getLookupLoadingSpec()
{
return LookupLoadingSpec.NONE;
}
+
+ @Override
+ public boolean isReady(TaskActionClient taskActionClient) throws Exception
+ {
+ final boolean isUsingConcurrentLocks = Boolean.TRUE.equals(
+ getContextValue(
+ Tasks.USE_CONCURRENT_LOCKS,
+ Tasks.DEFAULT_USE_CONCURRENT_LOCKS
+ )
+ );
+
+ TaskLockType defaultLockType = !markAsUnused && isUsingConcurrentLocks ?
TaskLockType.REPLACE : TaskLockType.EXCLUSIVE;
+
+ TaskLockType actualLockType = getContextValue(Tasks.TASK_LOCK_TYPE,
defaultLockType);
+
+ if (markAsUnused && actualLockType != TaskLockType.EXCLUSIVE) {
Review Comment:
`markAsUnused` is undocumented and has been deprecated for a few releases
since Druid 28. Instead of expanding on the legacy flag, we can target removing
it in Druid 31. It should simplify this code and related testing a bit. cc:
@kfaraz
@IgorBerman, would you be interested in doing that in a separate PR?
--
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]