From 7f44dfd85fc1aacd451cb8514fbce6dafd3443ca Mon Sep 17 00:00:00 2001 From: Yu Li Date: Mon, 4 Jul 2016 21:43:29 +0800 Subject: [PATCH] HBASE-16132 Scan does not return all the result when regionserver is busy (binlijin) --- .../hadoop/hbase/client/ScannerCallableWithReplicas.java | 6 +++++- .../org/apache/hadoop/hbase/master/HMasterCommandLine.java | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallableWithReplicas.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallableWithReplicas.java index a197e9093ac..0fbb2e7cc64 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallableWithReplicas.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallableWithReplicas.java @@ -202,6 +202,9 @@ class ScannerCallableWithReplicas implements RetryingCallable { updateCurrentlyServingReplica(r.getSecond(), r.getFirst(), done, pool); } return r == null ? null : r.getFirst(); // great we got an answer + } else { + throw new IOException("Failed to get result within timeout, timeout=" + + timeout + "ms"); } } catch (ExecutionException e) { RpcRetryingCallerWithReadReplicas.throwEnrichedException(e, retries); @@ -216,7 +219,8 @@ class ScannerCallableWithReplicas implements RetryingCallable { // calls succeeded or failed. In all case, we stop all our tasks. cs.cancelAll(); } - return null; // unreachable + LOG.error("Imposible? Arrive at an unreachable line..."); // unreachable + throw new IOException("Imposible? Arrive at an unreachable line..."); } private void updateCurrentlyServingReplica(ScannerCallable scanner, Result[] result, diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java index 0b94d24ef82..e53a7816b17 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java @@ -103,8 +103,7 @@ public class HMasterCommandLine extends ServerCommandLine { // minRegionServers used to be minServers. Support it too. if (cmd.hasOption("minServers")) { String val = cmd.getOptionValue("minServers"); - getConf().setInt("hbase.regions.server.count.min", - Integer.parseInt(val)); + getConf().setInt("hbase.regions.server.count.min", Integer.parseInt(val)); LOG.debug("minServers set to " + val); }