You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jd...@apache.org on 2010/06/23 22:43:10 UTC
svn commit: r957334 - in /hbase/branches/0.20: CHANGES.txt
src/java/org/apache/hadoop/hbase/client/HTable.java
Author: jdcryans
Date: Wed Jun 23 20:43:10 2010
New Revision: 957334
URL: http://svn.apache.org/viewvc?rev=957334&view=rev
Log:
HBASE-2772 Scan doesn't recover from region server failure
Modified:
hbase/branches/0.20/CHANGES.txt
hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HTable.java
Modified: hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.20/CHANGES.txt?rev=957334&r1=957333&r2=957334&view=diff
==============================================================================
--- hbase/branches/0.20/CHANGES.txt (original)
+++ hbase/branches/0.20/CHANGES.txt Wed Jun 23 20:43:10 2010
@@ -2,6 +2,7 @@ HBase Change Log
Release 0.20.6 - Unreleased
BUG FiXES
HBASE-2763 Cross-port HADOOP-6833 IPC parameter leak bug
+ HBASE-2772 Scan doesn't recover from region server failure
Release 0.20.5 - Unreleased
Modified: hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HTable.java?rev=957334&r1=957333&r2=957334&view=diff
==============================================================================
--- hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HTable.java (original)
+++ hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HTable.java Wed Jun 23 20:43:10 2010
@@ -2046,19 +2046,24 @@ public class HTable {
values = getConnection().getRegionServerWithRetries(callable);
}
} catch (DoNotRetryIOException e) {
- long timeout = lastNext + scannerTimeout;
- if (e instanceof UnknownScannerException &&
- timeout < System.currentTimeMillis()) {
- long elapsed = System.currentTimeMillis() - lastNext;
- ScannerTimeoutException ex = new ScannerTimeoutException(
- elapsed + "ms passed since the last invocation, " +
- "timeout is currently set to " + scannerTimeout);
- ex.initCause(e);
- throw ex;
- }
- Throwable cause = e.getCause();
- if (cause == null || !(cause instanceof NotServingRegionException)) {
- throw e;
+ if (e instanceof UnknownScannerException) {
+ long timeout = lastNext + scannerTimeout;
+ // If we are over the timeout, throw this exception to the client
+ // Else, it's because the region moved and we used the old id
+ // against the new region server; reset the scanner.
+ if (timeout < System.currentTimeMillis()) {
+ long elapsed = System.currentTimeMillis() - lastNext;
+ ScannerTimeoutException ex = new ScannerTimeoutException(
+ elapsed + "ms passed since the last invocation, " +
+ "timeout is currently set to " + scannerTimeout);
+ ex.initCause(e);
+ throw ex;
+ }
+ } else {
+ Throwable cause = e.getCause();
+ if (cause == null || !(cause instanceof NotServingRegionException)) {
+ throw e;
+ }
}
// Else, its signal from depths of ScannerCallable that we got an
// NSRE on a next and that we need to reset the scanner.