Author: tedyu
Date: Fri Sep 30 04:04:49 2011
New Revision: 1177499
URL: http://svn.apache.org/viewvc?rev=1177499&view=rev
Log:
HBASE-4412 No need to retry scan operation on the same server in case of
RegionServerStoppedException (Ming Ma)
Modified:
hbase/branches/0.92/CHANGES.txt
hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HTable.java
hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
Modified: hbase/branches/0.92/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1177499&r1=1177498&r2=1177499&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Fri Sep 30 04:04:49 2011
@@ -309,6 +309,8 @@ Release 0.92.0 - Unreleased
HBASE-3130 [replication] ReplicationSource can't recover from session
expired on remote clusters (Chris Trezzo via JD)
HBASE-4212 TestMasterFailover fails occasionally (Gao Jinchao)
+ HBASE-4412 No need to retry scan operation on the same server in case of
+ RegionServerStoppedException (Ming Ma)
TESTS
HBASE-4492 TestRollingRestart fails intermittently
Modified:
hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HTable.java
URL:
http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HTable.java?rev=1177499&r1=1177498&r2=1177499&view=diff
==============================================================================
---
hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HTable.java
(original)
+++
hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HTable.java
Fri Sep 30 04:04:49 2011
@@ -59,6 +59,7 @@ import org.apache.hadoop.hbase.client.Me
import org.apache.hadoop.hbase.client.coprocessor.Batch;
import org.apache.hadoop.hbase.ipc.CoprocessorProtocol;
import org.apache.hadoop.hbase.ipc.ExecRPCInvoker;
+import org.apache.hadoop.hbase.regionserver.RegionServerStoppedException;
import org.apache.hadoop.hbase.util.Addressing;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.Pair;
@@ -1201,7 +1202,8 @@ public class HTable implements HTableInt
}
} else {
Throwable cause = e.getCause();
- if (cause == null || !(cause instanceof
NotServingRegionException)) {
+ if (cause == null || (!(cause instanceof
NotServingRegionException)
+ && !(cause instanceof RegionServerStoppedException))) {
throw e;
}
}
Modified:
hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
URL:
http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java?rev=1177499&r1=1177498&r2=1177499&view=diff
==============================================================================
---
hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
(original)
+++
hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
Fri Sep 30 04:04:49 2011
@@ -28,6 +28,7 @@ import org.apache.hadoop.hbase.DoNotRetr
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.NotServingRegionException;
import org.apache.hadoop.hbase.RemoteExceptionHandler;
+import org.apache.hadoop.hbase.regionserver.RegionServerStoppedException;
import org.apache.hadoop.ipc.RemoteException;
@@ -88,6 +89,11 @@ public class ScannerCallable extends Ser
// when what we need is to open scanner against new location.
// Attach NSRE to signal client that it needs to resetup scanner.
throw new DoNotRetryIOException("Reset scanner", ioe);
+ } else if (ioe instanceof RegionServerStoppedException) {
+ // Throw a DNRE so that we break out of cycle of calling RSSE
+ // when what we need is to open scanner against new location.
+ // Attach RSSE to signal client that it needs to resetup scanner.
+ throw new DoNotRetryIOException("Reset scanner", ioe);
} else {
// The outer layers will retry
throw ioe;