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


##########
server/manager/src/main/java/org/apache/accumulo/manager/Manager.java:
##########
@@ -1391,15 +1451,60 @@ private long remaining(long deadline) {
     return Math.max(1, deadline - System.currentTimeMillis());
   }
 
+  private void getManagerLock() throws KeeperException, InterruptedException {
+    log.info("trying to get assistant manager lock");
+
+    final ZooReaderWriter zoo = getContext().getZooSession().asReaderWriter();
+    try {
+
+      var advertiseAddress = getAdvertiseAddress();
+
+      final ServiceLockPaths.ServiceLockPath zLockPath = 
getContext().getServerPaths()
+          .createManagerWorkerPath(getResourceGroup(), advertiseAddress);
+      ServiceLockSupport.createNonHaServiceLockPath(Type.MANAGER, zoo, 
zLockPath);
+
+      var serverLockUUID = UUID.randomUUID();
+      managerLock = new ServiceLock(getContext().getZooSession(), zLockPath, 
serverLockUUID);
+      ServiceLock.LockWatcher lw = new 
ServiceLockSupport.ServiceLockWatcher(Type.MANAGER,
+          () -> getShutdownComplete().get(),
+          (type) -> 
getContext().getLowMemoryDetector().logGCInfo(getContext().getConfiguration()));
+
+      for (int i = 0; i < 120 / 5; i++) {
+        zoo.putPersistentData(zLockPath.toString(), new byte[0], 
ZooUtil.NodeExistsPolicy.SKIP);
+
+        ServiceLockData.ServiceDescriptors descriptors = new 
ServiceLockData.ServiceDescriptors();
+        for (ServiceLockData.ThriftService svc : new 
ServiceLockData.ThriftService[] {
+            ThriftService.MANAGER}) {

Review Comment:
   updated in 00f5c14



##########
server/base/src/main/java/org/apache/accumulo/server/AbstractServer.java:
##########
@@ -285,7 +285,7 @@ public void runServer() throws Exception {
       verificationThread.interrupt();
       verificationThread.join();
     }
-    log.info(getClass().getSimpleName() + " process shut down.");
+    log.info(getClass().getSimpleName() + " process shut down. ");

Review Comment:
   updated in 00f5c14



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