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

Yu Li updated HDFS-5706:
------------------------

    Description: 
Now in TestBalancer.java, more than one test case will invoke the private 
method runBalancer, in which it will use Balancer.Parameters.Default, while the 
policy is never reset thus its totalUsedSpace and totalCapacity will increase 
continuously.

We can reveal this issue by simply change
{noformat}
testUnevenDistribution(conf,
        {color:red}new long[] {50*CAPACITY/100, 10*CAPACITY/100}{color},
        new long[]{CAPACITY, CAPACITY},
        new String[] {RACK0, RACK1});
{noformat}
in TestBalancer#testBalancer1Internal to
{code:title=TestBalancer#testBalancer1Internal}
testUnevenDistribution(conf,
        new long[] {70*CAPACITY/100, 40*CAPACITY/100},
        new long[]{CAPACITY, CAPACITY},
        new String[] {RACK0, RACK1});
{code}

  was:
Now in TestBalancer.java, more than one test case will invoke the private 
method runBalancer, in which it will use Balancer.Parameters.Default, while the 
policy is never reset thus its totalUsedSpace and totalCapacity will increase 
continuously.

We can reveal this issue by simply change
{code:title=TestBalancer#testBalancer1Internal }
testUnevenDistribution(conf,
        new long[] {50*CAPACITY/100, 10*CAPACITY/100},
        new long[]{CAPACITY, CAPACITY},
        new String[] {RACK0, RACK1});
{code}
to
{code:title=TestBalancer#testBalancer1Internal}
testUnevenDistribution(conf,
        new long[] {70*CAPACITY/100, 40*CAPACITY/100},
        new long[]{CAPACITY, CAPACITY},
        new String[] {RACK0, RACK1});
{code}


> Should reset Balancer.Parameters.DEFALUT.policy in TestBalancer
> ---------------------------------------------------------------
>
>                 Key: HDFS-5706
>                 URL: https://issues.apache.org/jira/browse/HDFS-5706
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: balancer
>            Reporter: Yu Li
>            Priority: Minor
>
> Now in TestBalancer.java, more than one test case will invoke the private 
> method runBalancer, in which it will use Balancer.Parameters.Default, while 
> the policy is never reset thus its totalUsedSpace and totalCapacity will 
> increase continuously.
> We can reveal this issue by simply change
> {noformat}
> testUnevenDistribution(conf,
>         {color:red}new long[] {50*CAPACITY/100, 10*CAPACITY/100}{color},
>         new long[]{CAPACITY, CAPACITY},
>         new String[] {RACK0, RACK1});
> {noformat}
> in TestBalancer#testBalancer1Internal to
> {code:title=TestBalancer#testBalancer1Internal}
> testUnevenDistribution(conf,
>         new long[] {70*CAPACITY/100, 40*CAPACITY/100},
>         new long[]{CAPACITY, CAPACITY},
>         new String[] {RACK0, RACK1});
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to