diff --git a/CHANGES.txt b/CHANGES.txt index 906efe1bcec..5de7bb2d0c6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -319,6 +319,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-4450 test for number of blocks read: to serve as baseline for expected diff --git a/src/main/java/org/apache/hadoop/hbase/client/HTable.java b/src/main/java/org/apache/hadoop/hbase/client/HTable.java index b5cf6396328..cc605912f98 100644 --- a/src/main/java/org/apache/hadoop/hbase/client/HTable.java +++ b/src/main/java/org/apache/hadoop/hbase/client/HTable.java @@ -59,6 +59,7 @@ import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitor; 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 HTableInterface, Closeable { } } else { Throwable cause = e.getCause(); - if (cause == null || !(cause instanceof NotServingRegionException)) { + if (cause == null || (!(cause instanceof NotServingRegionException) + && !(cause instanceof RegionServerStoppedException))) { throw e; } } diff --git a/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java b/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java index 5ea38b444bd..20be3846fdb 100644 --- a/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java +++ b/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java @@ -28,6 +28,7 @@ import org.apache.hadoop.hbase.DoNotRetryIOException; 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 ServerCallable { // 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;