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
This commit is contained in:
Michael Stack 2009-01-13 05:58:51 +00:00
parent 33789132f1
commit a59ddf299e
2 changed files with 12 additions and 11 deletions

View File

@ -139,6 +139,7 @@ Release 0.19.0 - Unreleased
HBASE-1114 Weird NPEs compacting HBASE-1114 Weird NPEs compacting
HBASE-1116 generated web.xml and svn don't play nice together HBASE-1116 generated web.xml and svn don't play nice together
HBASE-1119 ArrayOutOfBoundsException in HStore.compact HBASE-1119 ArrayOutOfBoundsException in HStore.compact
HBASE-1121 Cluster confused about where -ROOT- is
IMPROVEMENTS IMPROVEMENTS
HBASE-901 Add a limit to key length, check key and value length on client side HBASE-901 Add a limit to key length, check key and value length on client side

View File

@ -211,13 +211,13 @@ public class HConnectionManager implements HConstants {
} }
} catch (IOException e) { } catch (IOException e) {
if(tries == numRetries - 1) { if (tries == numRetries - 1) {
// This was our last chance - don't bother sleeping // This was our last chance - don't bother sleeping
break; break;
} }
LOG.info("Attempt " + tries + " of " + this.numRetries + LOG.info("getMaster attempt " + tries + " of " + this.numRetries +
" failed with <" + e + ">. Retrying after sleep of " + " failed; retrying after sleep of " +
getPauseTime(tries)); getPauseTime(tries), e);
} }
// Cannot connect to master or it is not running. Sleep & retry // 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 (tries < numRetries - 1) {
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Attempt " + tries + " of " + this.numRetries + LOG.debug("locateRegionInMeta attempt " + tries + " of " +
" failed with <" + e + ">. Retrying after sleep of " + this.numRetries + " failed; retrying after sleep of " +
getPauseTime(tries)); getPauseTime(tries), e);
} }
relocateRegion(parentTable, metaKey); relocateRegion(parentTable, metaKey);
} else { } else {
@ -747,7 +747,6 @@ public class HConnectionManager implements HConstants {
HServerAddress rootRegionAddress = null; HServerAddress rootRegionAddress = null;
for (int tries = 0; tries < numRetries; tries++) { for (int tries = 0; tries < numRetries; tries++) {
int localTimeouts = 0; int localTimeouts = 0;
// ask the master which server has the root region // ask the master which server has the root region
while (rootRegionAddress == null && localTimeouts < numRetries) { while (rootRegionAddress == null && localTimeouts < numRetries) {
rootRegionAddress = master.findRootRegion(); rootRegionAddress = master.findRootRegion();
@ -772,13 +771,13 @@ public class HConnectionManager implements HConstants {
// get a connection to the region server // get a connection to the region server
HRegionInterface server = getHRegionConnection(rootRegionAddress); HRegionInterface server = getHRegionConnection(rootRegionAddress);
try { try {
// if this works, then we're good, and we have an acceptable address, // if this works, then we're good, and we have an acceptable address,
// so we can stop doing retries and return the result. // so we can stop doing retries and return the result.
server.getRegionInfo(HRegionInfo.ROOT_REGIONINFO.getRegionName()); server.getRegionInfo(HRegionInfo.ROOT_REGIONINFO.getRegionName());
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Found ROOT " + HRegionInfo.ROOT_REGIONINFO); LOG.debug("Found ROOT at " + rootRegionAddress +
" (server=" + server + ")");
} }
break; break;
} catch (IOException e) { } catch (IOException e) {
@ -875,7 +874,8 @@ public class HConnectionManager implements HConstants {
private HRegionLocation private HRegionLocation
getRegionLocationForRowWithRetries(byte[] tableName, byte[] rowKey, getRegionLocationForRowWithRetries(byte[] tableName, byte[] rowKey,
boolean reload) throws IOException { boolean reload)
throws IOException {
getMaster(); getMaster();
List<Throwable> exceptions = new ArrayList<Throwable>(); List<Throwable> exceptions = new ArrayList<Throwable>();
HRegionLocation location = null; HRegionLocation location = null;