Ian Maxon has uploaded a new change for review. https://asterix-gerrit.ics.uci.edu/2654
Change subject: [ASTERIXDB-2388] Add nodeIDs to cluster state query failure exception ...................................................................... [ASTERIXDB-2388] Add nodeIDs to cluster state query failure exception Change-Id: I8684f01c483595f1488537d82335d79f173f1517 --- M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java 1 file changed, 15 insertions(+), 2 deletions(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/54/2654/2 diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java index 0eb8e0a..0042638 100644 --- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java +++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java @@ -18,11 +18,15 @@ */ package org.apache.asterix.translator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; import org.apache.asterix.common.api.IClusterManagementWork.ClusterState; +import org.apache.asterix.common.cluster.ClusterPartition; import org.apache.asterix.common.cluster.IClusterStateManager; import org.apache.asterix.common.cluster.IGlobalRecoveryManager; import org.apache.asterix.common.dataflow.ICcApplicationContext; @@ -69,8 +73,17 @@ Thread.currentThread().interrupt(); } if (!clusterStateManager.getState().equals(ClusterState.ACTIVE)) { - throw new AsterixException("Cluster is in " + ClusterState.UNUSABLE + " state." - + "\n One or more Node Controllers have left or haven't joined yet.\n"); + ClusterPartition[] configuredPartitions = clusterStateManager.getClusterPartitons(); + List<String> inactiveNodes = new ArrayList<>(); + for (ClusterPartition cp : configuredPartitions) { + if (!cp.isActive()) { + inactiveNodes.add(cp.getNodeId()); + } + } + throw new AsterixException("Not all node controllers required" + " for query execution" + + " have joined the cluster. Nodes " + Arrays.toString(inactiveNodes.toArray()) + " appear " + + "missing," + "double check" + " the logs on these machines and the cluster " + + "configuration"); } else { if (LOGGER.isInfoEnabled()) { LOGGER.info("Cluster is now " + ClusterState.ACTIVE); -- To view, visit https://asterix-gerrit.ics.uci.edu/2654 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8684f01c483595f1488537d82335d79f173f1517 Gerrit-PatchSet: 2 Gerrit-Project: asterixdb Gerrit-Branch: release-0.9.4-pre-rc Gerrit-Owner: Ian Maxon <ima...@apache.org> Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu>