AmatyaAvadhanula commented on code in PR #16393:
URL: https://github.com/apache/druid/pull/16393#discussion_r1592396943


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:
##########
@@ -1271,6 +1277,134 @@ public void remove(final Task task)
     }
   }
 
+  /**
+   * Verifies that every lock held by the replacing task is a REPLACE lock
+   * @param task replacing task
+   */
+  public void verifyLocksForReplaceTask(Task task)
+  {
+    for (TaskLockPosse lockPosse : findLockPossesForTask(task)) {
+      if (lockPosse.taskLock.getType() != TaskLockType.REPLACE) {
+        throw DruidException.defensive(
+            "All the locks must be of type REPLACE for 
segmentTransactionalReplace. Found lock of type[%s] for task[%s].",

Review Comment:
   Thanks for pointing it out. I think the message needs to be changed 
appropriately in that case.
   If not, why can't this method be a part of the validation to acquire the 
transactional lock as was being done previously?



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