keith-turner commented on code in PR #5786:
URL: https://github.com/apache/accumulo/pull/5786#discussion_r2305180617


##########
core/src/main/java/org/apache/accumulo/core/fate/AdminUtil.java:
##########
@@ -282,36 +293,42 @@ private void findLocks(ZooSession zk, final 
ServiceLockPath lockPath,
         SortedSet<FateLock.NodeName> lockNodes =
             FateLock.validateAndWarn(fLockPath, 
zr.getChildren(fLockPath.toString()));
 
-        int pos = 0;
-        boolean sawWriteLock = false;
+        ArrayList<FateLock.FateLockEntry> previous = new 
ArrayList<>(lockNodes.size());
 
         for (FateLock.NodeName node : lockNodes) {
           try {
             FateLock.FateLockEntry fateLockEntry = node.fateLockEntry.get();
             var fateId = fateLockEntry.getFateId();
             var lockType = fateLockEntry.getLockType();
 
-            if (lockType == LockType.WRITE) {
-              sawWriteLock = true;
-            }
+            lockRanges.put(fateId, fateLockEntry.getRange());
 
-            Map<FateId,List<String>> locks;
+            Map<FateId,List<String>> locks = heldLocks;
 
-            if (pos == 0) {
-              locks = heldLocks;
-            } else if (lockType == LockType.READ && !sawWriteLock) {
-              locks = heldLocks;
+            if (lockType == LockType.WRITE) {
+              for (var prev : Lists.reverse(previous)) {

Review Comment:
   I think this code is ok because its not called too frequently.



-- 
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: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to