You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by dl...@apache.org on 2022/08/03 20:09:03 UTC
[accumulo] branch main updated: Added logging to try and find the cause of the intermittent ZK failures (#2846)
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 78fde4dba4 Added logging to try and find the cause of the intermittent ZK failures (#2846)
78fde4dba4 is described below
commit 78fde4dba433e5808ffb5daca75703461fb4a43a
Author: Dave Marion <dl...@apache.org>
AuthorDate: Wed Aug 3 16:08:57 2022 -0400
Added logging to try and find the cause of the intermittent ZK failures (#2846)
---
.../miniclusterImpl/MiniAccumuloClusterImpl.java | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
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 a7ccba9bd7..c366c96dca 100644
--- a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
@@ -98,7 +98,9 @@ import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.DFSConfigKeys;
import org.apache.hadoop.hdfs.MiniDFSCluster;
+import org.apache.zookeeper.AsyncCallback.StringCallback;
import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.ZKUtil;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.ZooKeeper.States;
import org.slf4j.Logger;
@@ -531,6 +533,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
}
if (!config.useExistingZooKeepers()) {
+ log.warn("Starting ZooKeeper");
control.start(ServerType.ZOOKEEPER);
}
@@ -575,6 +578,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
args.add(config.getRootPassword());
}
+ log.warn("Initializing ZooKeeper");
Process initProcess = exec(Initialize.class, args.toArray(new String[0])).getProcess();
int ret = initProcess.waitFor();
if (ret != 0) {
@@ -582,6 +586,8 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
+ ". Check the logs in " + config.getLogDir() + " for errors.");
}
initialized = true;
+ } else {
+ log.warn("Not initializing ZooKeeper, already initialized");
}
}
@@ -667,6 +673,21 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
}
if (instanceId == null) {
+ 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, new StringCallback() {
+ @Override
+ public void processResult(int rc, String path, Object ctx, String name) {
+ log.warn("{}", path);
+ }
+ });
+ log.warn("******* END ZK DUMP ************");
+ } catch (KeeperException | InterruptedException e) {
+ log.error("Error dumping zk", e);
+ }
throw new IllegalStateException("Unable to find instance id from zookeeper.");
}