EdColeman commented on code in PR #3230:
URL: https://github.com/apache/accumulo/pull/3230#discussion_r1130223681


##########
server/manager/src/main/java/org/apache/accumulo/manager/upgrade/PreUpgradeValidation.java:
##########
@@ -117,4 +141,114 @@ private void fail(Exception e) {
     System.exit(1);
   }
 
+  private void validateTableLocks(final ServerContext context) {
+
+    final ZooReaderWriter zrw = context.getZooReaderWriter();
+    final ZooKeeper zk = zrw.getZooKeeper();
+    final String rootPath = context.getZooKeeperRoot();
+    final String tserverLockRoot = rootPath + Constants.ZTSERVERS;
+
+    log.debug("Looking for locks that may be from previous version in path: 
{}", tserverLockRoot);
+
+    AtomicInteger errorCount = new AtomicInteger(0);
+
+    List<Pair<HostAndPort,ServiceLock.ServiceLockPath>> hostsWithLocks =
+        gatherLocks(zk, tserverLockRoot);
+
+    // try a thrift call to the hosts - hosts running previous versions will 
fail the call
+    ThreadPoolExecutor lockCheckPool = 
ThreadPools.getServerThreadPools().createThreadPool(8, 32,
+        10, MINUTES, "update-lock-check", false);
+    try {
+      Future<?> f = lockCheckPool.submit(() -> 
hostsWithLocks.parallelStream().forEach(p -> {

Review Comment:
   reworked in a2839d07c704a8



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

Reply via email to