huaxiangsun opened a new pull request #2629:
URL: https://github.com/apache/hbase/pull/2629
… load over meta replica regions
It adds load balance support for meta lookup in AsyncTableRegionLocator.
The existing meta replica mode is renamed as "HedgedRead", client sends scan
request to the primary meta replica region first,
if response is not back within a configured amount of time, it will send
scan requests to all meta replica regions and
take the first response. On top of the existing mode, a new mode
"LoadBalance" is introduced. In this mode, client first
choose a meta replica region to send scan request. If the response is stale,
it may send the request to another meta replica region or
the primary region. In this mode, meta scan requests are load balanced
across all replica regions with the primary mode as
the ultimate source of truth.
Two new config knobs are added:
1. hbase.locator.meta.replicas.mode
Valid options are "None", "HedgedRead" and "LoadBalance", they are case
insensitive. The default mode is "None".
2. hbase.locator.meta.replicas.mode.loadbalance.selector
The load balance alogrithm to select a meta replica to send the requests.
Only
org.apache.hadoop.hbase.client.CatalogReplicaLoadBalanceReplicaSimpleSelector.class
is supported for now, which is the default as well. The algorithm works
as follows:
a. Clients select a randome meta replica region to send the requests
if there is no entry for the location in the stale
location cache.
b. If the location from one meta replica region is stale, a stale
entry will be created in the statle location cache
for the region.
c. Clients select the primary meta region if the location is in the
stale location cache.
d. The stale location cache entries time out in 3 seconds.
If there is no "hbase.locator.meta.replicas.mode" configured, it will check
the config knob "hbase.meta.replicas.use".
If "hbase.meta.replicas.use" is configured, the mode will be set to
"HedgedRead".
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]