HBASE-17587 Do not Rethrow DoNotRetryIOException as UnknownScannerException

Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
Zach York 2017-02-02 02:44:58 -08:00 committed by Andrew Purtell
parent 7294931e62
commit 537580bc51
1 changed files with 7 additions and 3 deletions

View File

@ -83,7 +83,6 @@ import org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException;
import org.apache.hadoop.hbase.exceptions.ScannerResetException;
import org.apache.hadoop.hbase.filter.ByteArrayComparable;
import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
import org.apache.hadoop.hbase.io.hfile.CorruptHFileException;
import org.apache.hadoop.hbase.ipc.HBaseRPCErrorHandler;
import org.apache.hadoop.hbase.ipc.HBaseRpcController;
import org.apache.hadoop.hbase.ipc.PriorityFunction;
@ -3095,12 +3094,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 CorruptHFileException or a FileNotFoundException, throw the
// If it is a FileNotFoundException, wrap as a
// DoNotRetryIOException. This can avoid the retry in ClientScanner.
if (e instanceof CorruptHFileException || e instanceof FileNotFoundException) {
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.