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

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

commit 1bb822367113d099c01dec409d624d0a4024102a
Merge: b4bd0e9387 ef1ecd0071
Author: Dom G <[email protected]>
AuthorDate: Thu Oct 1 16:56:07 2026 -0400

    Merge branch '2.1' into main

 .../accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java    | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --cc 
minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
index c88be11aa3,cf550433f2..a7d1a4a740
--- 
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
+++ 
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
@@@ -837,69 -661,116 +837,75 @@@ public class MiniAccumuloClusterImpl im
      waitForProcessStart(getClusterControl().gcProcess, "GC");
  
      int tsExpectedCount = 0;
 -    for (Process tsp : getClusterControl().tabletServerProcesses) {
 -      tsExpectedCount++;
 -      requireNonNull(tsp, "Error starting TabletServer " + tsExpectedCount + 
" - no process");
 -      waitForProcessStart(tsp, "TabletServer" + tsExpectedCount);
 +    for (List<Process> tabletServerProcesses : 
getClusterControl().tabletServerProcesses.values()) {
 +      for (Process tsp : tabletServerProcesses) {
 +        tsExpectedCount++;
 +        requireNonNull(tsp, "Error starting TabletServer " + tsExpectedCount 
+ " - no process");
 +        waitForProcessStart(tsp, "TabletServer" + tsExpectedCount);
 +      }
      }
  
 -    try (ZooKeeper zk = new ZooKeeper(getZooKeepers(), 60000, event -> 
log.warn("{}", event))) {
 -
 -      String secret = getSiteConfiguration().get(Property.INSTANCE_SECRET);
 -
 -      while (!(zk.getState() == States.CONNECTED)) {
 -        log.info("Waiting for ZK client to connect, state: {} - will retry", 
zk.getState());
 -        Thread.sleep(1000);
 +    int ssExpectedCount = 0;
 +    for (List<Process> scanServerProcesses : 
getClusterControl().scanServerProcesses.values()) {
 +      for (Process tsp : scanServerProcesses) {
 +        ssExpectedCount++;
 +        requireNonNull(tsp, "Error starting ScanServer " + ssExpectedCount + 
" - no process");
 +        waitForProcessStart(tsp, "ScanServer" + ssExpectedCount);
        }
 +    }
  
 -      String instanceId = null;
 -      for (int i = 0; i < numTries; i++) {
 -        if (zk.getState() == States.CONNECTED) {
 -          ZooUtil.digestAuth(zk, secret);
 -          try {
 -            final AtomicInteger rc = new AtomicInteger();
 -            final CountDownLatch waiter = new CountDownLatch(1);
 -            zk.sync("/", (code, arg1, arg2) -> {
 -              rc.set(code);
 -              waiter.countDown();
 -            }, null);
 -            waiter.await();
 -            Code code = Code.get(rc.get());
 -            if (code != Code.OK) {
 -              throw KeeperException.create(code);
 -            }
 -            String instanceNamePath =
 -                Constants.ZROOT + Constants.ZINSTANCES + "/" + 
config.getInstanceName();
 -            byte[] bytes = zk.getData(instanceNamePath, null, null);
 -            instanceId = new String(bytes, UTF_8);
 -            break;
 -          } catch (KeeperException e) {
 -            log.warn("Error trying to read instance id from zookeeper: " + 
e.getMessage());
 -            log.debug("Unable to read instance id from zookeeper.", e);
 -          }
 -        } else {
 -          log.warn("ZK client not connected, state: {}", zk.getState());
 -        }
 -        Thread.sleep(1000);
 +    int ecExpectedCount = 0;
 +    for (List<Process> compactorProcesses : 
getClusterControl().compactorProcesses.values()) {
 +      for (Process ecp : compactorProcesses) {
 +        ecExpectedCount++;
 +        requireNonNull(ecp, "Error starting compactor " + ecExpectedCount + " 
- no process");
 +        waitForProcessStart(ecp, "Compactor" + ecExpectedCount);
        }
 +    }
  
 -      if (instanceId == null) {
 -        for (int i = 0; i < numTries; i++) {
 -          if (zk.getState() == States.CONNECTED) {
 -            ZooUtil.digestAuth(zk, secret);
 -            try {
 -              log.warn("******* COULD NOT FIND INSTANCE ID - DUMPING ZK 
************");
 -              log.warn("Connected to ZooKeeper: {}", getZooKeepers());
 -              log.warn("Looking for instanceId at {}",
 -                  Constants.ZROOT + Constants.ZINSTANCES + "/" + 
config.getInstanceName());
 -              ZKUtil.visitSubTreeDFS(zk, Constants.ZROOT, false,
 -                  (rc, path, ctx, name) -> log.warn("{}", path));
 -              log.warn("******* END ZK DUMP ************");
 -            } catch (KeeperException | InterruptedException e) {
 -              if (e instanceof InterruptedException) {
 -                Thread.currentThread().interrupt();
 -              }
 -              log.error("Error dumping zk", e);
 -            }
 -          }
 -          Thread.sleep(1000);
 -        }
 -        throw new IllegalStateException("Unable to find instance id from 
zookeeper.");
 +    int tsActualCount = 0;
 +    while (tsActualCount < tsExpectedCount) {
 +      Set<ServiceLockPath> tservers = context.getServerPaths()
 +          .getTabletServer(ResourceGroupPredicate.ANY, AddressSelector.all(), 
true);
 +      tsActualCount = tservers.size();
 +      log.info(tsActualCount + " of " + tsExpectedCount + " tablet servers 
present in ZooKeeper");
-       Thread.sleep(500);
++      if (tsActualCount < tsExpectedCount) {
++        Thread.sleep(500);
+       }
 +    }
  
 -      String rootPath = Constants.ZROOT + "/" + instanceId;
 -      int tsActualCount = 0;
 -      try {
 -        while (tsActualCount < tsExpectedCount) {
 -          tsActualCount = 0;
 -          for (String child : zk.getChildren(rootPath + Constants.ZTSERVERS, 
null)) {
 -            if (zk.getChildren(rootPath + Constants.ZTSERVERS + "/" + child, 
null).isEmpty()) {
 -              log.info("TServer " + tsActualCount + " not yet present in 
ZooKeeper");
 -            } else {
 -              tsActualCount++;
 -              log.info("TServer " + tsActualCount + " present in ZooKeeper");
 -            }
 -          }
 -          if (tsActualCount < tsExpectedCount) {
 -            Thread.sleep(500);
 -          }
 -        }
 -      } catch (KeeperException e) {
 -        throw new IllegalStateException("Unable to read TServer information 
from zookeeper.", e);
 +    int ssActualCount = 0;
 +    while (ssActualCount < ssExpectedCount) {
 +      Set<ServiceLockPath> tservers = context.getServerPaths()
 +          .getScanServer(ResourceGroupPredicate.ANY, AddressSelector.all(), 
true);
 +      ssActualCount = tservers.size();
 +      log.info(ssActualCount + " of " + ssExpectedCount + " scan servers 
present in ZooKeeper");
-       Thread.sleep(500);
++      if (ssActualCount < ssExpectedCount) {
++        Thread.sleep(500);
+       }
 +    }
  
 -      try {
 -        while (zk.getChildren(rootPath + Constants.ZMANAGER_LOCK, 
null).isEmpty()) {
 -          log.info("Manager not yet present in ZooKeeper");
 -          Thread.sleep(500);
 -        }
 -      } catch (KeeperException e) {
 -        throw new IllegalStateException("Unable to read Manager information 
from zookeeper.", e);
 +    int ecActualCount = 0;
 +    while (ecActualCount < ecExpectedCount) {
 +      Set<ServiceLockPath> compactors = context.getServerPaths()
 +          .getCompactor(ResourceGroupPredicate.ANY, AddressSelector.all(), 
true);
 +      ecActualCount = compactors.size();
 +      log.info(ecActualCount + " of " + ecExpectedCount + " compactors 
present in ZooKeeper");
-       Thread.sleep(500);
++      if (ecActualCount < ecExpectedCount) {
++        Thread.sleep(500);
+       }
 +    }
  
 -      try {
 -        while (zk.getChildren(rootPath + Constants.ZGC_LOCK, null).isEmpty()) 
{
 -          log.info("GC not yet present in ZooKeeper");
 -          Thread.sleep(500);
 -        }
 -      } catch (KeeperException e) {
 -        throw new IllegalStateException("Unable to read GC information from 
zookeeper.", e);
 -      }
 +    while (context.getServerPaths().getManager(true) == null) {
 +      log.info("Manager not yet present in ZooKeeper");
 +      Thread.sleep(500);
 +    }
  
 +    while (context.getServerPaths().getGarbageCollector(true) == null) {
 +      log.info("GC not yet present in ZooKeeper");
 +      Thread.sleep(500);
      }
 +
    }
  
    private List<String> buildRemoteDebugParams(int port) {

Reply via email to