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


##########
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:
   How does this class know that `segmentTransactionalReplace` is the one 
calling this? And if it is the only one calling this method, then this method 
might as well just live there as before. Same for append.



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