HBASE-1045 Hangup by regionserver causes write to fail

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@728460 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2008-12-21 17:08:44 +00:00
parent a23e45f4b7
commit 80eb7de81d
2 changed files with 9 additions and 9 deletions

View File

@ -111,6 +111,7 @@ Release 0.19.0 - Unreleased
HBASE-1068 TestCompaction broken on hudson HBASE-1068 TestCompaction broken on hudson
HBASE-1067 TestRegionRebalancing broken by running of hdfs shutdown thread HBASE-1067 TestRegionRebalancing broken by running of hdfs shutdown thread
HBASE-1070 Up default index interval in TRUNK and branch HBASE-1070 Up default index interval in TRUNK and branch
HBASE-1045 Hangup by regionserver causes write to fail
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

@ -880,9 +880,6 @@ public class HConnectionManager implements HConstants {
if (t instanceof DoNotRetryIOException) { if (t instanceof DoNotRetryIOException) {
throw (DoNotRetryIOException) t; throw (DoNotRetryIOException) t;
} }
if (t instanceof IOException) {
throw (IOException) t;
}
} }
return null; return null;
} }
@ -893,6 +890,7 @@ public class HConnectionManager implements HConstants {
if (list.isEmpty()) { if (list.isEmpty()) {
return; return;
} }
boolean retryOnlyOne = false;
Collections.sort(list); Collections.sort(list);
List<BatchUpdate> tempUpdates = new ArrayList<BatchUpdate>(); List<BatchUpdate> tempUpdates = new ArrayList<BatchUpdate>();
byte[] currentRegion = getRegionLocation(tableName, list.get(0).getRow(), byte[] currentRegion = getRegionLocation(tableName, list.get(0).getRow(),
@ -908,7 +906,7 @@ public class HConnectionManager implements HConstants {
region = getRegionLocation(tableName, list.get(i + 1).getRow(), false) region = getRegionLocation(tableName, list.get(i + 1).getRow(), false)
.getRegionInfo().getRegionName(); .getRegionInfo().getRegionName();
} }
if (!Bytes.equals(currentRegion, region) || isLastRow) { if (!Bytes.equals(currentRegion, region) || isLastRow || retryOnlyOne) {
final BatchUpdate[] updates = tempUpdates.toArray(new BatchUpdate[0]); final BatchUpdate[] updates = tempUpdates.toArray(new BatchUpdate[0]);
int index = getRegionServerForWithoutRetries(new ServerCallable<Integer>( int index = getRegionServerForWithoutRetries(new ServerCallable<Integer>(
this, tableName, batchUpdate.getRow()) { this, tableName, batchUpdate.getRow()) {
@ -926,13 +924,10 @@ public class HConnectionManager implements HConstants {
} }
long sleepTime = getPauseTime(tries); long sleepTime = getPauseTime(tries);
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Eeloading table servers because region " + LOG.debug("Reloading table servers because region " +
"server didn't accept updates; tries=" + tries + "server didn't accept updates; tries=" + tries +
" of max=" + this.numRetries + ", waiting=" + sleepTime + "ms"); " of max=" + this.numRetries + ", waiting=" + sleepTime + "ms");
} }
// Basic waiting time. If many updates are flushed, tests have shown
// that this is barely needed but when commiting 1 update this may
// get retried hundreds of times.
try { try {
Thread.sleep(sleepTime); Thread.sleep(sleepTime);
tries++; tries++;
@ -940,10 +935,14 @@ public class HConnectionManager implements HConstants {
// continue // continue
} }
i = i - updates.length + index; i = i - updates.length + index;
retryOnlyOne = true;
region = getRegionLocation(tableName, list.get(i + 1).getRow(), region = getRegionLocation(tableName, list.get(i + 1).getRow(),
true).getRegionInfo().getRegionName(); true).getRegionInfo().getRegionName();
} }
else {
retryOnlyOne = false;
}
currentRegion = region; currentRegion = region;
tempUpdates.clear(); tempUpdates.clear();
} }