From a59ddf299ecc63f9c06d4825f836c53a7a49c8ef Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Tue, 13 Jan 2009 05:58:51 +0000 Subject: [PATCH] HBASE-1121 Cluster confused about where -ROOT- is; commit better logging git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@734047 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../hbase/client/HConnectionManager.java | 22 +++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index ef579faf9f2..092eee71f92 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -139,6 +139,7 @@ Release 0.19.0 - Unreleased HBASE-1114 Weird NPEs compacting HBASE-1116 generated web.xml and svn don't play nice together HBASE-1119 ArrayOutOfBoundsException in HStore.compact + HBASE-1121 Cluster confused about where -ROOT- is IMPROVEMENTS HBASE-901 Add a limit to key length, check key and value length on client side diff --git a/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java index 3caf4dc8d02..ad630ae2c76 100644 --- a/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -211,13 +211,13 @@ public class HConnectionManager implements HConstants { } } catch (IOException e) { - if(tries == numRetries - 1) { + if (tries == numRetries - 1) { // This was our last chance - don't bother sleeping break; } - LOG.info("Attempt " + tries + " of " + this.numRetries + - " failed with <" + e + ">. Retrying after sleep of " + - getPauseTime(tries)); + LOG.info("getMaster attempt " + tries + " of " + this.numRetries + + " failed; retrying after sleep of " + + getPauseTime(tries), e); } // Cannot connect to master or it is not running. Sleep & retry @@ -550,9 +550,9 @@ public class HConnectionManager implements HConstants { } if (tries < numRetries - 1) { if (LOG.isDebugEnabled()) { - LOG.debug("Attempt " + tries + " of " + this.numRetries + - " failed with <" + e + ">. Retrying after sleep of " + - getPauseTime(tries)); + LOG.debug("locateRegionInMeta attempt " + tries + " of " + + this.numRetries + " failed; retrying after sleep of " + + getPauseTime(tries), e); } relocateRegion(parentTable, metaKey); } else { @@ -747,7 +747,6 @@ public class HConnectionManager implements HConstants { HServerAddress rootRegionAddress = null; for (int tries = 0; tries < numRetries; tries++) { int localTimeouts = 0; - // ask the master which server has the root region while (rootRegionAddress == null && localTimeouts < numRetries) { rootRegionAddress = master.findRootRegion(); @@ -772,13 +771,13 @@ public class HConnectionManager implements HConstants { // get a connection to the region server HRegionInterface server = getHRegionConnection(rootRegionAddress); - try { // if this works, then we're good, and we have an acceptable address, // so we can stop doing retries and return the result. server.getRegionInfo(HRegionInfo.ROOT_REGIONINFO.getRegionName()); if (LOG.isDebugEnabled()) { - LOG.debug("Found ROOT " + HRegionInfo.ROOT_REGIONINFO); + LOG.debug("Found ROOT at " + rootRegionAddress + + " (server=" + server + ")"); } break; } catch (IOException e) { @@ -875,7 +874,8 @@ public class HConnectionManager implements HConstants { private HRegionLocation getRegionLocationForRowWithRetries(byte[] tableName, byte[] rowKey, - boolean reload) throws IOException { + boolean reload) + throws IOException { getMaster(); List exceptions = new ArrayList(); HRegionLocation location = null;