hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject hbase git commit: HBASE-16752 addendum. Do not retry large request for client versions less than 1.3
Date Thu, 20 Oct 2016 17:43:20 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 29a60d0ee -> 3efa3b911


HBASE-16752 addendum. Do not retry large request for client versions less than 1.3

Signed-off-by: Gary Helmling <garyh@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3efa3b91
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3efa3b91
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3efa3b91

Branch: refs/heads/branch-1.3
Commit: 3efa3b911294fe0a42440e2aef3865898d91acc0
Parents: 29a60d0
Author: Ashu Pachauri <ashu210890@gmail.com>
Authored: Wed Oct 19 16:50:52 2016 -0700
Committer: Gary Helmling <garyh@apache.org>
Committed: Thu Oct 20 10:40:58 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/exceptions/RequestTooBigException.java     | 6 +++++-
 .../main/java/org/apache/hadoop/hbase/ipc/RpcServer.java    | 9 ++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/3efa3b91/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RequestTooBigException.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RequestTooBigException.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RequestTooBigException.java
index 31baebb..0021f4a 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RequestTooBigException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RequestTooBigException.java
@@ -26,13 +26,17 @@ import org.apache.hadoop.hbase.classification.InterfaceStability;
  * Thrown when the size of the rpc request received by the server is too large.
  *
  * On receiving such an exception, the client does not retry the offending rpc.
+ * @since 1.3.0
  */
 @InterfaceAudience.Public
 @InterfaceStability.Evolving
 public class RequestTooBigException extends DoNotRetryIOException {
-
   private static final long serialVersionUID = -1593339239809586516L;
 
+  // Recognized only in HBase version 1.3 and higher.
+  public static final int MAJOR_VERSION = 1;
+  public static final int MINOR_VERSION = 3;
+
   public RequestTooBigException() {
     super();
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/3efa3b91/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
index cf5ce2d..9bf6dfd 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
@@ -1684,7 +1684,14 @@ public class RpcServer implements RpcServerInterface, ConfigurationObserver
{
             Call reqTooBig = new Call(header.getCallId(), this.service, null, null, null,
                 null, this, responder, 0, null, this.addr,0);
             metrics.exception(REQUEST_TOO_BIG_EXCEPTION);
-            setupResponse(null, reqTooBig, REQUEST_TOO_BIG_EXCEPTION, msg);
+            // Make sure the client recognizes the underlying exception
+            // Otherwise, throw a DoNotRetryIOException.
+            if (VersionInfoUtil.hasMinimumVersion(connectionHeader.getVersionInfo(),
+                RequestTooBigException.MAJOR_VERSION, RequestTooBigException.MINOR_VERSION))
{
+              setupResponse(null, reqTooBig, REQUEST_TOO_BIG_EXCEPTION, msg);
+            } else {
+              setupResponse(null, reqTooBig, new DoNotRetryIOException(), msg);
+            }
             // We are going to close the connection, make sure we process the response
             // before that. In rare case when this fails, we still close the connection.
             responseWriteLock.lock();


Mime
View raw message