[ 
https://issues.apache.org/jira/browse/HBASE-21439?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrew Purtell reopened HBASE-21439:
------------------------------------

Although TestStochasticLoadBalancer passes on all branches, including 1.3/1.5/1 
with the backport patch I attached here, an rsgroups balancer test fails. I 
noticed this first when testing branch-1, but it also fails on master.

We will need an addendum to fix the test failure please.

I don't know why this failure wasn't picked up during precommit. Anyway, it is 
100% reproducible locally.

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running 
org.apache.hadoop.hbase.master.balancer.TestRSGroupBasedLoadBalancerWithStochasticLoadBalancerAsInternal
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.844 s 
<<< FAILURE! - in 
org.apache.hadoop.hbase.master.balancer.TestRSGroupBasedLoadBalancerWithStochasticLoadBalancerAsInternal
[ERROR] 
testBalanceCluster(org.apache.hadoop.hbase.master.balancer.TestRSGroupBasedLoadBalancerWithStochasticLoadBalancerAsInternal)
  Time elapsed: 0.543 s  <<< FAILURE!
java.lang.AssertionError: expected:<2> but was:<0>
    at 
org.apache.hadoop.hbase.master.balancer.TestRSGroupBasedLoadBalancerWithStochasticLoadBalancerAsInternal.testBalanceCluster(TestRSGroupBasedLoadBalancerWithStochasticLoadBalancerAsInternal.java:148)

> StochasticLoadBalancer RegionLoads aren’t being used in RegionLoad cost 
> functions
> ---------------------------------------------------------------------------------
>
>                 Key: HBASE-21439
>                 URL: https://issues.apache.org/jira/browse/HBASE-21439
>             Project: HBase
>          Issue Type: Bug
>          Components: Balancer
>    Affects Versions: 1.3.2.1, 2.0.2
>            Reporter: Ben Lau
>            Assignee: Ben Lau
>            Priority: Major
>             Fix For: 3.0.0
>
>         Attachments: HBASE-21439-branch-1.patch, HBASE-21439-master.patch
>
>
> In StochasticLoadBalancer.updateRegionLoad() the region loads are being put 
> into the map with Bytes.toString(regionName).
> First, this is a problem because Bytes.toString() assumes that the byte array 
> is a UTF8 encoded String but there is no guarantee that regionName bytes are 
> legal UTF8.
> Secondly, in BaseLoadBalancer.registerRegion, we are reading the region loads 
> out of the load map not using Bytes.toString() but using 
> region.getRegionNameAsString() and region.getEncodedName().  So the load 
> balancer will not see or use any of the cluster's RegionLoad history.
> There are 2 primary ways to solve this issue, assuming we want to stay with 
> String keys for the load map (seems reasonable to aid debugging).  We can 
> either fix updateRegionLoad to store the regionName as a string properly or 
> we can update both the reader & writer to use a new common valid String 
> representation.
> Will post a patch assuming we want to pursue the original intention, i.e. 
> store regionNameAsAString for the loadmap key, but I'm open to fixing this a 
> different way.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to