dlmarion commented on code in PR #5246:
URL: https://github.com/apache/accumulo/pull/5246#discussion_r1913238004


##########
minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java:
##########
@@ -824,9 +825,47 @@ public synchronized void stop() throws IOException, 
InterruptedException {
 
     control.stop(ServerType.GARBAGE_COLLECTOR, null);
     control.stop(ServerType.MANAGER, null);
+    control.stop(ServerType.COMPACTION_COORDINATOR);
     control.stop(ServerType.TABLET_SERVER, null);
+    control.stop(ServerType.COMPACTOR, null);
+    control.stop(ServerType.SCAN_SERVER, null);
+
+    // The method calls above kill the server
+    // Clean up the locks in ZooKeeper fo that if the cluster
+    // is restarted, then the processes will start right away
+    // and not wait for the old locks to be cleaned up.
+    try {
+      System.setProperty("accumulo.properties", "file://" + 
getAccumuloPropertiesPath());
+      new ZooZap().zap(getServerContext().getSiteConfiguration(), new String[] 
{"-manager",
+          "-compaction-coordinators", "-tservers", "-compactors", 
"-sservers"});
+    } catch (Exception e) {
+      log.error("Error zapping zookeeper locks", e);
+    }
     control.stop(ServerType.ZOOKEEPER, null);
 
+    // Clear the location of the servers in ZooCache.
+    // When ZooKeeper was stopped in the previous method call,
+    // the local ZooKeeper watcher did not fire. If MAC is
+    // restarted, then ZooKeeper will start on the same port with
+    // the same data, but no Watchers will fire.

Review Comment:
   I believe that a session expired KeeperException will be returned to the 
ZooKeeper client when the ZooKeeper server is re-started on the same port. But 
I don't think that watchers will fire when the first ZooKeeper server is 
terminated, or when the new ZooKeeper server is started. The code does 
eventually behave correctly, as the tests do complete successfully, but 
removing these paths from the ZooCache speed things up. 



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