You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Michael Stack (Jira)" <ji...@apache.org> on 2019/10/15 04:51:00 UTC
[jira] [Comment Edited] (HBASE-22739)
ArrayIndexOutOfBoundsException when balance
[ https://issues.apache.org/jira/browse/HBASE-22739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16951599#comment-16951599 ]
Michael Stack edited comment on HBASE-22739 at 10/15/19 4:50 AM:
-----------------------------------------------------------------
HBASE-23173 is duplicate of this. Has a PR that just addresses the AIOBE. Code has been same for long time so perturbed by some recent commit? Why it is happening would necessitate spending time in balancer. The removeRegion is used in a good few places. Meantime my cluster won't balance. I don't have RSGroup enabled. Does have replicas enabled.
Here is PR w/ change and test. Needs work because some balancer tests are failing. Closed it out while we figure what to do here. https://github.com/apache/hbase/pull/723
was (Author: stack):
HBASE-23173 is duplicate of this. Has a PR that just addresses the AIOBE. Code has been same for long time so perturbed by some recent commit? Why it is happening would necessitate spending time in balancer. The removeRegion is used in a good few places. Meantime my cluster won't balance. I don't have RSGroup enabled. Does have replicas enabled..
> ArrayIndexOutOfBoundsException when balance
> -------------------------------------------
>
> Key: HBASE-22739
> URL: https://issues.apache.org/jira/browse/HBASE-22739
> Project: HBase
> Issue Type: Bug
> Components: Balancer
> Reporter: casuallc
> Priority: Major
> Fix For: 2.1.1
>
>
>
> {code:java}
> 2019-07-25 15:19:59,828 ERROR [master/nna:16000.Chore.1] hbase.ScheduledChore: Caught error
> java.lang.ArrayIndexOutOfBoundsException: 3171
> at org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer$Cluster.removeRegion(BaseLoadBalancer.java:873)
> at org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer$Cluster.doAction(BaseLoadBalancer.java:716)
> at org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer.balanceCluster(StochasticLoadBalancer.java:407)
> at org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer.balanceCluster(StochasticLoadBalancer.java:318)
> at org.apache.hadoop.hbase.master.HMaster.balance(HMaster.java:1650)
> at org.apache.hadoop.hbase.master.HMaster.balance(HMaster.java:1567)
> at org.apache.hadoop.hbase.master.balancer.BalancerChore.chore(BalancerChore.java:49)
> at org.apache.hadoop.hbase.ScheduledChore.run(ScheduledChore.java:186)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
> at org.apache.hadoop.hbase.JitterScheduledThreadPoolExecutorImpl$JitteredRunnableScheduledFuture.run(JitterScheduledThreadPoolExecutorImpl.java:111)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> {code}
> should check if the regionIndex is valid when removeRegion,
> java: hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
> {code:java}
> int[] removeRegion(int[] regions, int regionIndex) {
> //TODO: this maybe costly. Consider using linked lists
> int[] newRegions = new int[regions.length - 1];
> int i = 0;
> for (i = 0; i < regions.length; i++) {
> if (regions[i] == regionIndex) {
> break;
> }
> if (i == regions.length - 1) {
> return Arrays.copyOf(regions, regions.length);
> }
> newRegions[i] = regions[i];
> }
> System.arraycopy(regions, i+1, newRegions, i, newRegions.length - i);
> return newRegions;
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)