You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2019/01/18 01:16:40 UTC
[hbase] branch branch-1 updated: HBASE-21727 Simplify documentation
around client timeout
This is an automated email from the ASF dual-hosted git repository.
apurtell pushed a commit to branch branch-1
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-1 by this push:
new cad3630 HBASE-21727 Simplify documentation around client timeout
cad3630 is described below
commit cad3630c70011e4b9878dc106341a460b8fb6487
Author: Peter Somogyi <ps...@apache.org>
AuthorDate: Tue Jan 15 15:24:34 2019 +0100
HBASE-21727 Simplify documentation around client timeout
Signed-off-by: Michael Stack <st...@apache.org>
Conflicts:
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java
src/main/asciidoc/_chapters/configuration.adoc
src/main/asciidoc/_chapters/troubleshooting.adoc
Amending-Author: Andrew Purtell <ap...@apache.org>
---
.../apache/hadoop/hbase/client/ClientScanner.java | 7 ++----
.../hadoop/hbase/client/RpcRetryingCaller.java | 20 ++++++++++++---
.../apache/hadoop/hbase/HBaseConfiguration.java | 29 ----------------------
.../java/org/apache/hadoop/hbase/HConstants.java | 2 +-
.../hadoop/hbase/TestHBaseConfiguration.java | 25 -------------------
src/main/asciidoc/_chapters/configuration.adoc | 25 ++++++++++++++++++-
src/main/asciidoc/_chapters/troubleshooting.adoc | 4 +--
7 files changed, 45 insertions(+), 67 deletions(-)
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java
index 8665eea..143f202 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java
@@ -31,7 +31,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.DoNotRetryIOException;
-import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.NotServingRegionException;
@@ -114,10 +113,8 @@ public abstract class ClientScanner extends AbstractClientScanner {
this.maxScannerResultSize = conf.getLong(HConstants.HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE_KEY,
HConstants.DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE);
}
- this.scannerTimeout =
- HBaseConfiguration.getInt(conf, HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD,
- HConstants.HBASE_REGIONSERVER_LEASE_PERIOD_KEY,
- HConstants.DEFAULT_HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD);
+ this.scannerTimeout = conf.getInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD,
+ HConstants.DEFAULT_HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD);
// check if application wants to collect scan metrics
initScanMetrics(scan);
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCaller.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCaller.java
index af24d5c..10f88e3 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCaller.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCaller.java
@@ -36,6 +36,7 @@ import org.apache.hadoop.hbase.exceptions.PreemptiveFastFailException;
import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
import org.apache.hadoop.hbase.util.ExceptionUtil;
import org.apache.hadoop.ipc.RemoteException;
+import org.apache.hadoop.util.StringUtils;
import com.google.protobuf.ServiceException;
@@ -149,10 +150,21 @@ public class RpcRetryingCaller<T> {
interceptor.handleFailure(context, t);
t = translateException(t);
if (tries > startLogErrorsCnt) {
- LOG.info("Call exception, tries=" + tries + ", retries=" + retries + ", started=" +
- (EnvironmentEdgeManager.currentTime() - this.globalStartTime) + " ms ago, "
- + "cancelled=" + cancelled.get() + ", msg="
- + t.getMessage() + " " + callable.getExceptionMessageAdditionalDetail());
+ if (LOG.isInfoEnabled()) {
+ StringBuilder builder = new StringBuilder("Call exception, tries=").append(tries)
+ .append(", retries=").append(retries).append(", started=")
+ .append(EnvironmentEdgeManager.currentTime() - this.globalStartTime)
+ .append(" ms ago, ").append("cancelled=").append(cancelled.get())
+ .append(", msg=").append(t.getMessage())
+ .append(", details=").append(callable.getExceptionMessageAdditionalDetail())
+ .append(", see https://s.apache.org/timeout");
+ if (LOG.isDebugEnabled()) {
+ builder.append(", exception=").append(StringUtils.stringifyException(t));
+ LOG.debug(builder.toString());
+ } else {
+ LOG.info(builder.toString());
+ }
+ }
}
callable.throwable(t, retries != 1);
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java
index 94d4483..c984aeb 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java
@@ -172,35 +172,6 @@ public class HBaseConfiguration extends Configuration {
}
/**
- * Get the value of the <code>name</code> property as an <code>int</code>, possibly
- * referring to the deprecated name of the configuration property.
- * If no such property exists, the provided default value is returned,
- * or if the specified value is not a valid <code>int</code>,
- * then an error is thrown.
- *
- * @param name property name.
- * @param deprecatedName a deprecatedName for the property to use
- * if non-deprecated name is not used
- * @param defaultValue default value.
- * @throws NumberFormatException when the value is invalid
- * @return property value as an <code>int</code>,
- * or <code>defaultValue</code>.
- */
- // TODO: developer note: This duplicates the functionality of deprecated
- // property support in Configuration in Hadoop 2. But since Hadoop-1 does not
- // contain these changes, we will do our own as usual. Replace these when H2 is default.
- public static int getInt(Configuration conf, String name,
- String deprecatedName, int defaultValue) {
- if (conf.get(deprecatedName) != null) {
- LOG.warn(String.format("Config option \"%s\" is deprecated. Instead, use \"%s\""
- , deprecatedName, name));
- return conf.getInt(deprecatedName, defaultValue);
- } else {
- return conf.getInt(name, defaultValue);
- }
- }
-
- /**
* Get the password from the Configuration instance using the
* getPassword method if it exists. If not, then fall back to the
* general get method for configuration elements.
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 3d1115b..594bb0e 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
@@ -302,7 +302,7 @@ public final class HConstants {
/** Parameter name for HBase client operation timeout. */
public static final String HBASE_CLIENT_OPERATION_TIMEOUT = "hbase.client.operation.timeout";
- /** Parameter name for HBase client operation timeout. */
+ /** Parameter name for HBase client meta operation timeout. */
public static final String HBASE_CLIENT_META_OPERATION_TIMEOUT =
"hbase.client.meta.operation.timeout";
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java
index 1aa052b..d8aed04 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java
@@ -51,31 +51,6 @@ public class TestHBaseConfiguration {
}
@Test
- public void testGetIntDeprecated() {
- int VAL = 1, VAL2 = 2;
- String NAME = "foo";
- String DEPRECATED_NAME = "foo.deprecated";
-
- Configuration conf = HBaseConfiguration.create();
- conf.setInt(NAME, VAL);
- assertEquals(VAL, HBaseConfiguration.getInt(conf, NAME, DEPRECATED_NAME, 0));
-
- conf = HBaseConfiguration.create();
- conf.setInt(DEPRECATED_NAME, VAL);
- assertEquals(VAL, HBaseConfiguration.getInt(conf, NAME, DEPRECATED_NAME, 0));
-
- conf = HBaseConfiguration.create();
- conf.setInt(DEPRECATED_NAME, VAL);
- conf.setInt(NAME, VAL);
- assertEquals(VAL, HBaseConfiguration.getInt(conf, NAME, DEPRECATED_NAME, 0));
-
- conf = HBaseConfiguration.create();
- conf.setInt(DEPRECATED_NAME, VAL);
- conf.setInt(NAME, VAL2); // deprecated value will override this
- assertEquals(VAL, HBaseConfiguration.getInt(conf, NAME, DEPRECATED_NAME, 0));
- }
-
- @Test
public void testSubset() throws Exception {
Configuration conf = HBaseConfiguration.create();
// subset is used in TableMapReduceUtil#initCredentials to support different security
diff --git a/src/main/asciidoc/_chapters/configuration.adoc b/src/main/asciidoc/_chapters/configuration.adoc
index 6e930aa..5e7d16d 100644
--- a/src/main/asciidoc/_chapters/configuration.adoc
+++ b/src/main/asciidoc/_chapters/configuration.adoc
@@ -634,7 +634,30 @@ Configuration config = HBaseConfiguration.create();
config.set("hbase.zookeeper.quorum", "localhost"); // Here we are running zookeeper locally
----
-If multiple ZooKeeper instances make up your ZooKeeper ensemble, they may be specified in a comma-separated list (just as in the _hbase-site.xml_ file). This populated `Configuration` instance can then be passed to an link:http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Table.html[Table], and so on.
+If multiple ZooKeeper instances make up your ZooKeeper ensemble, they may be specified in a comma-separated list (just as in the _hbase-site.xml_ file). This populated `Configuration` instance can then be passed to an link:https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Table.html[Table], and so on.
+
+[[config_timeouts]]
+=== Timeout settings
+
+HBase provides a wide variety of timeout settings to limit the execution time of various remote operations.
+
+* hbase.rpc.timeout
+* hbase.rpc.read.timeout
+* hbase.rpc.write.timeout
+* hbase.client.operation.timeout
+* hbase.client.meta.operation.timeout
+* hbase.client.scanner.timeout.period
+
+The `hbase.rpc.timeout` property limits how long a single RPC call can run before timing out.
+To fine tune read or write related RPC timeouts set `hbase.rpc.read.timeout` and `hbase.rpc.write.timeout` configuration properties.
+In the absence of these properties `hbase.rpc.timeout` will be used.
+
+A higher-level timeout is `hbase.client.operation.timeout` which is valid for each client call.
+When an RPC call fails for instance for a timeout due to `hbase.rpc.timeout` it will be retried until `hbase.client.operation.timeout` is reached.
+Client operation timeout for system tables can be fine tuned by setting `hbase.client.meta.operation.timeout` configuration value.
+When this is not set its value will use `hbase.client.operation.timeout`.
+
+Timeout for scan operations is controlled differently. Use `hbase.client.scanner.timeout.period` property to set this timeout.
[[example_config]]
== Example Configurations
diff --git a/src/main/asciidoc/_chapters/troubleshooting.adoc b/src/main/asciidoc/_chapters/troubleshooting.adoc
index 1776c9e..2166f60 100644
--- a/src/main/asciidoc/_chapters/troubleshooting.adoc
+++ b/src/main/asciidoc/_chapters/troubleshooting.adoc
@@ -582,8 +582,8 @@ See also Jesse Andersen's link:http://blog.cloudera.com/blog/2014/04/how-to-use-
In some situations clients that fetch data from a RegionServer get a LeaseException instead of the usual <<trouble.client.scantimeout>>.
Usually the source of the exception is `org.apache.hadoop.hbase.regionserver.Leases.removeLease(Leases.java:230)` (line number may vary). It tends to happen in the context of a slow/freezing `RegionServer#next` call.
-It can be prevented by having `hbase.rpc.timeout` > `hbase.regionserver.lease.period`.
-Harsh J investigated the issue as part of the mailing list thread link:http://mail-archives.apache.org/mod_mbox/hbase-user/201209.mbox/%3CCAOcnVr3R-LqtKhFsk8Bhrm-YW2i9O6J6Fhjz2h7q6_sxvwd2yw%40mail.gmail.com%3E[HBase, mail # user - Lease does not exist exceptions]
+It can be prevented by having `hbase.rpc.timeout` > `hbase.client.scanner.timeout.period`.
+Harsh J investigated the issue as part of the mailing list thread link:https://mail-archives.apache.org/mod_mbox/hbase-user/201209.mbox/%3CCAOcnVr3R-LqtKhFsk8Bhrm-YW2i9O6J6Fhjz2h7q6_sxvwd2yw%40mail.gmail.com%3E[HBase, mail # user - Lease does not exist exceptions]
[[trouble.client.scarylogs]]
=== Shell or client application throws lots of scary exceptions during normal operation