Repository: hbase Updated Branches: refs/heads/master 553373671 -> f1691e3d0
HBASE-16752 addendum. Do not retry large request for client versions less than 1.3 Signed-off-by: Gary Helmling <ga...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f1691e3d Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f1691e3d Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f1691e3d Branch: refs/heads/master Commit: f1691e3d0d0b650d569540f4711f1f0ba2b5701e Parents: 5533736 Author: Ashu Pachauri <ashu210...@gmail.com> Authored: Wed Oct 19 16:50:52 2016 -0700 Committer: Gary Helmling <ga...@apache.org> Committed: Thu Oct 20 10:34:01 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/f1691e3d/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/f1691e3d/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 542510c..836c4bc 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 @@ -1658,7 +1658,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();