Skip to content

Commit

Permalink
16361: using shared lock types by default for kill tasks unless markA…
Browse files Browse the repository at this point in the history
…sUnused is on
  • Loading branch information
IgorBerman committed Apr 30, 2024
1 parent b18b192 commit 82b91a9
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.apache.druid.indexer.report.KillTaskReport;
import org.apache.druid.indexer.report.TaskReport;
import org.apache.druid.indexing.common.TaskLock;
import org.apache.druid.indexing.common.TaskLockType;
import org.apache.druid.indexing.common.TaskToolbox;
import org.apache.druid.indexing.common.actions.MarkSegmentsAsUnusedAction;
import org.apache.druid.indexing.common.actions.RetrieveUnusedSegmentsAction;
Expand Down Expand Up @@ -343,6 +344,9 @@ private NavigableMap<DateTime, List<TaskLock>> getNonRevokedTaskLockMap(TaskActi
@Override
public boolean isReady(TaskActionClient taskActionClient) throws Exception
{
return super.isReady(taskActionClient, getContextValue(Tasks.TASK_LOCK_TYPE, Tasks.DEFAULT_TASK_LOCK_TYPE));
if (markAsUnused) {
return super.isReady(taskActionClient);
}
return super.isReady(taskActionClient, getContextValue(Tasks.TASK_LOCK_TYPE, TaskLockType.SHARED));
}
}

0 comments on commit 82b91a9

Please sign in to comment.