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-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

View File

@ -215,9 +215,9 @@ public class HConnectionManager implements HConstants {
// 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<Throwable> exceptions = new ArrayList<Throwable>();
HRegionLocation location = null;