diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java index 3ec74351e9d..0c439c7987b 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java @@ -651,6 +651,16 @@ public final class HConstants { */ public static int DEFAULT_HBASE_RPC_TIMEOUT = 60000; + /** + * timeout for short operation RPC + */ + public static String HBASE_RPC_SHORTOPERATION_TIMEOUT_KEY = "hbase.rpc.shortoperation.timeout"; + + /** + * Default value of {@link #HBASE_RPC_SHORTOPERATION_TIMEOUT_KEY} + */ + public static int DEFAULT_HBASE_RPC_SHORTOPERATION_TIMEOUT = 10000; + /** * Value indicating the server name was saved with no sequence number. */ diff --git a/hbase-common/src/main/resources/hbase-default.xml b/hbase-common/src/main/resources/hbase-default.xml index b2494bf3926..e0b30628dd3 100644 --- a/hbase-common/src/main/resources/hbase-default.xml +++ b/hbase-common/src/main/resources/hbase-default.xml @@ -675,6 +675,14 @@ possible configurations would overwhelm and obscure the important. take for a remote call to time out. It uses pings to check connections but will eventually throw a TimeoutException. + + hbase.rpc.shortoperation.timeout + 10000 + This is another version of "hbase.rpc.timeout". For those RPC operation + within cluster, we rely on this configuration to set a short timeout limitation + for short operation. For example, short rpc timeout for region server's trying + to report to active master can benefit quicker master failover process. + hbase.ipc.client.tcpnodelay true diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 5015ade6ac6..8e035fbf9d6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -521,8 +521,8 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa "hbase.regionserver.numregionstoreport", 10); this.rpcTimeout = conf.getInt( - HConstants.HBASE_RPC_TIMEOUT_KEY, - HConstants.DEFAULT_HBASE_RPC_TIMEOUT); + HConstants.HBASE_RPC_SHORTOPERATION_TIMEOUT_KEY, + HConstants.DEFAULT_HBASE_RPC_SHORTOPERATION_TIMEOUT); this.abortRequested = false; this.stopped = false;