HBASE-19359 Revisit the default config of hbase client retries number

This commit is contained in:
Guanghao Zhang 2017-11-28 21:08:19 +08:00 committed by Michael Stack
parent f81ac42aa3
commit abb535eef6
No known key found for this signature in database
GPG Key ID: 9816C7FC8ACC93D2
9 changed files with 18 additions and 10 deletions

View File

@ -2628,4 +2628,4 @@ public interface Admin extends Abortable, Closeable {
* @return List of servers that are not cleared
*/
List<ServerName> clearDeadServers(final List<ServerName> servers) throws IOException;
}
}

View File

@ -116,7 +116,8 @@ public final class ConnectionUtils {
HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER);
// Go big. Multiply by 10. If we can't get to meta after this many retries
// then something seriously wrong.
int serversideMultiplier = c.getInt("hbase.client.serverside.retries.multiplier", 10);
int serversideMultiplier = c.getInt(HConstants.HBASE_CLIENT_SERVERSIDE_RETRIES_MULTIPLIER,
HConstants.DEFAULT_HBASE_CLIENT_SERVERSIDE_RETRIES_MULTIPLIER);
int retries = hcRetries * serversideMultiplier;
c.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, retries);
log.info(sn + " server-side Connection retries=" + retries);

View File

@ -774,7 +774,12 @@ public final class HConstants {
/**
* Default value of {@link #HBASE_CLIENT_RETRIES_NUMBER}.
*/
public static final int DEFAULT_HBASE_CLIENT_RETRIES_NUMBER = 35;
public static final int DEFAULT_HBASE_CLIENT_RETRIES_NUMBER = 10;
public static final String HBASE_CLIENT_SERVERSIDE_RETRIES_MULTIPLIER =
"hbase.client.serverside.retries.multiplier";
public static final int DEFAULT_HBASE_CLIENT_SERVERSIDE_RETRIES_MULTIPLIER = 3;
/**
* Parameter name to set the default scanner caching for all clients.

View File

@ -488,7 +488,7 @@ possible configurations would overwhelm and obscure the important.
</property>
<property>
<name>hbase.client.retries.number</name>
<value>35</value>
<value>10</value>
<description>Maximum retries. Used as maximum for all retryable
operations such as the getting of a cell's value, starting a row update,
etc. Retry interval is a rough function based on hbase.client.pause. At

View File

@ -3533,4 +3533,4 @@ public class HMaster extends HRegionServer implements MasterServices {
public SpaceQuotaSnapshotNotifier getSpaceQuotaSnapshotNotifier() {
return this.spaceQuotaSnapshotNotifier;
}
}
}

View File

@ -1957,7 +1957,7 @@ public class HRegionServer extends HasThread implements
conf.getInt("hbase.log.replay.retries.number", 8)); // 8 retries take about 23 seconds
sinkConf.setInt(HConstants.HBASE_RPC_TIMEOUT_KEY,
conf.getInt("hbase.log.replay.rpc.timeout", 30000)); // default 30 seconds
sinkConf.setInt("hbase.client.serverside.retries.multiplier", 1);
sinkConf.setInt(HConstants.HBASE_CLIENT_SERVERSIDE_RETRIES_MULTIPLIER, 1);
if (this.csm != null) {
// SplitLogWorker needs csm. If none, don't start this.
this.splitLogWorker = new SplitLogWorker(this, sinkConf, this,

View File

@ -96,7 +96,8 @@ public class RegionReplicaFlushHandler extends EventHandler {
int numRetries = conf.getInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER);
if (numRetries > 10) {
int mult = conf.getInt("hbase.client.serverside.retries.multiplier", 10);
int mult = conf.getInt(HConstants.HBASE_CLIENT_SERVERSIDE_RETRIES_MULTIPLIER,
HConstants.DEFAULT_HBASE_CLIENT_SERVERSIDE_RETRIES_MULTIPLIER);
numRetries = numRetries / mult; // reset if HRS has multiplied this already
}
return numRetries;

View File

@ -119,11 +119,12 @@ public class RegionReplicaReplicationEndpoint extends HBaseReplicationEndpoint {
int defaultNumRetries = conf.getInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER);
if (defaultNumRetries > 10) {
int mult = conf.getInt("hbase.client.serverside.retries.multiplier", 10);
int mult = conf.getInt(HConstants.HBASE_CLIENT_SERVERSIDE_RETRIES_MULTIPLIER,
HConstants.DEFAULT_HBASE_CLIENT_SERVERSIDE_RETRIES_MULTIPLIER);
defaultNumRetries = defaultNumRetries / mult; // reset if HRS has multiplied this already
}
conf.setInt("hbase.client.serverside.retries.multiplier", 1);
conf.setInt(HConstants.HBASE_CLIENT_SERVERSIDE_RETRIES_MULTIPLIER, 1);
int numRetries = conf.getInt(CLIENT_RETRIES_NUMBER, defaultNumRetries);
conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, numRetries);

View File

@ -101,7 +101,7 @@ public class TestRegionReplicaReplicationEndpoint {
conf.setInt("replication.stats.thread.period.seconds", 5);
conf.setBoolean("hbase.tests.use.shortcircuit.reads", false);
conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 5); // less number of retries is needed
conf.setInt("hbase.client.serverside.retries.multiplier", 1);
conf.setInt(HConstants.HBASE_CLIENT_SERVERSIDE_RETRIES_MULTIPLIER, 1);
HTU.startMiniCluster(NB_SERVERS);
}