This is an automated email from the ASF dual-hosted git repository.

dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new 1a63463f9d Removed manager primary lock in ZooZap, fix calls to ZooZap 
(#6246)
1a63463f9d is described below

commit 1a63463f9df7758736260b796e1f182700a1d72e
Author: Dave Marion <[email protected]>
AuthorDate: Wed Mar 25 13:24:53 2026 -0400

    Removed manager primary lock in ZooZap, fix calls to ZooZap (#6246)
    
    Calls to ZooZap were failing in some ITs because it could
    not create the ServerContext. This was an issue from a
    prior change to reorganize the commands and the
    ServerKeywordExecutable class was created that creates
    the ServerContext. In the ITs the system property for
    the accumulo.properties file location needs to be set
    before calling one of the ServerKeywordExecutable
    classes. In this case the issue manifested as an
    exception in the test output when MiniAccumuloCluster
    was stopped with a message saying that it could not
    find the instance.volumes property.
    
    This commit also fixes ZooZap to remove the primary
    manager lock in addition to the assistant manager
    locks. The prior address was still in place in the
    primary lock causing the AdvertiseAndBindIT to fail.
---
 .../apache/accumulo/miniclusterImpl/MiniAccumuloClusterControl.java    | 3 +++
 .../org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java   | 2 ++
 server/base/src/main/java/org/apache/accumulo/server/util/ZooZap.java  | 3 +++
 .../main/java/org/apache/accumulo/test/functional/CompactionIT.java    | 2 +-
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterControl.java
 
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterControl.java
index f45c4fcb87..ba221d188a 100644
--- 
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterControl.java
+++ 
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterControl.java
@@ -37,6 +37,7 @@ import java.util.concurrent.TimeoutException;
 import org.apache.accumulo.cluster.ClusterControl;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.conf.SiteConfiguration;
 import org.apache.accumulo.core.data.ResourceGroupId;
 import org.apache.accumulo.minicluster.ServerType;
 import org.apache.accumulo.miniclusterImpl.MiniAccumuloClusterImpl.ProcessInfo;
@@ -317,6 +318,8 @@ public class MiniAccumuloClusterControl implements 
ClusterControl {
             cluster.stopProcessesWithTimeout(ServerType.MANAGER, 
managerProcesses, 30,
                 TimeUnit.SECONDS);
             try {
+              
System.setProperty(SiteConfiguration.ACCUMULO_PROPERTIES_PROPERTY,
+                  "file://" + cluster.getAccumuloPropertiesPath());
               new ZooZap().execute(new String[] {"-managers"});
             } catch (Exception e) {
               log.error("Error zapping Manager zookeeper lock", e);
diff --git 
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
 
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
index 77f7571fba..3cc46361de 100644
--- 
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
+++ 
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
@@ -1030,6 +1030,8 @@ public class MiniAccumuloClusterImpl implements 
AccumuloCluster {
     // is restarted, then the processes will start right away
     // and not wait for the old locks to be cleaned up.
     try {
+      System.setProperty(SiteConfiguration.ACCUMULO_PROPERTIES_PROPERTY,
+          "file://" + getAccumuloPropertiesPath());
       new ZooZap()
           .execute(new String[] {"-managers", "-tservers", "-compactors", 
"-sservers", "--gc"});
     } catch (Exception e) {
diff --git 
a/server/base/src/main/java/org/apache/accumulo/server/util/ZooZap.java 
b/server/base/src/main/java/org/apache/accumulo/server/util/ZooZap.java
index fb0ad2210d..c5b417885b 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/ZooZap.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/ZooZap.java
@@ -149,6 +149,9 @@ public class ZooZap extends 
ServerKeywordExecutable<ZapOpts> {
             zrw.recursiveDelete(serverLockPath.toString(), 
NodeMissingPolicy.SKIP);
           }
         }
+        ServiceLockPath primaryMgrPath = 
context.getServerPaths().createManagerPath();
+        filterSingleton(context, primaryMgrPath, addressSelector)
+            .ifPresent(slp -> removeSingletonLock(zrw, slp, opts));
       } catch (RuntimeException e) {
         log.error("Error deleting manager lock", e);
       }
diff --git 
a/test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java 
b/test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java
index 2172a27471..897eb46137 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java
@@ -796,7 +796,7 @@ public class CompactionIT extends CompactionITBase {
       });
       assertNotNull(interCompactionFile[0]);
       System.setProperty(SiteConfiguration.ACCUMULO_PROPERTIES_PROPERTY,
-          getCluster().getAccumuloPropertiesPath());
+          "file://" + getCluster().getAccumuloPropertiesPath());
       String[] args = new String[1];
       args[0] = finalCompactionFile;
       PrintBCInfo bcInfo = new PrintBCInfo(args);

Reply via email to