Repository: hbase Updated Branches: refs/heads/branch-1 f59cf6f02 -> cd847e599 refs/heads/branch-1.3 69766274e -> 8a831e9dd
HBASE-17587 Do not Rethrow DoNotRetryIOException as UnknownScannerException Signed-off-by: Andrew Purtell <apurt...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8a831e9d Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8a831e9d Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8a831e9d Branch: refs/heads/branch-1.3 Commit: 8a831e9ddab221d9d3da1f3653af05738181bd52 Parents: 6976627 Author: Zach York <zy...@amazon.com> Authored: Thu Feb 2 02:44:58 2017 -0800 Committer: Andrew Purtell <apurt...@apache.org> Committed: Thu Feb 2 17:08:27 2017 -0800 ---------------------------------------------------------------------- .../apache/hadoop/hbase/regionserver/RSRpcServices.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/8a831e9d/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java index 290b492..65e0220 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java @@ -25,6 +25,7 @@ import com.google.protobuf.RpcController; import com.google.protobuf.ServiceException; import com.google.protobuf.TextFormat; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InterruptedIOException; import java.net.BindException; @@ -2850,6 +2851,17 @@ public class RSRpcServices implements HBaseRPCErrorHandler, // row that the client has last seen. closeScanner(region, scanner, scannerName, context); + // rethrow DoNotRetryIOException. This can avoid the retry in ClientScanner. + if (e instanceof DoNotRetryIOException) { + throw e; + } + + // If it is a FileNotFoundException, wrap as a + // DoNotRetryIOException. This can avoid the retry in ClientScanner. + if (e instanceof FileNotFoundException) { + throw new DoNotRetryIOException(e); + } + // We closed the scanner already. Instead of throwing the IOException, and client // retrying with the same scannerId only to get USE on the next RPC, we directly throw // a special exception to save an RPC.