You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Hudson (Jira)" <ji...@apache.org> on 2022/03/27 11:21:00 UTC
[jira] [Commented] (HBASE-26872) Load rate calculator for cost functions should be more precise
[ https://issues.apache.org/jira/browse/HBASE-26872?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17512930#comment-17512930 ]
Hudson commented on HBASE-26872:
--------------------------------
Results for branch branch-2.5
[build #78 on builds.a.o|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/78/]: (x) *{color:red}-1 overall{color}*
----
details (if available):
(x) {color:red}-1 general checks{color}
-- For more information [see general report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/78/General_20Nightly_20Build_20Report/]
(x) {color:red}-1 jdk8 hadoop2 checks{color}
-- For more information [see jdk8 (hadoop2) report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/78/JDK8_20Nightly_20Build_20Report_20_28Hadoop2_29/]
(x) {color:red}-1 jdk8 hadoop3 checks{color}
-- For more information [see jdk8 (hadoop3) report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/78/JDK8_20Nightly_20Build_20Report_20_28Hadoop3_29/]
(x) {color:red}-1 jdk11 hadoop3 checks{color}
-- For more information [see jdk11 report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/78/JDK11_20Nightly_20Build_20Report_20_28Hadoop3_29/]
(x) {color:red}-1 source release artifact{color}
-- See build output for details.
(x) {color:red}-1 client integration test{color}
-- Something went wrong with this stage, [check relevant console output|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/78//console].
> Load rate calculator for cost functions should be more precise
> --------------------------------------------------------------
>
> Key: HBASE-26872
> URL: https://issues.apache.org/jira/browse/HBASE-26872
> Project: HBase
> Issue Type: Improvement
> Components: Balancer
> Affects Versions: 2.4.11
> Reporter: Xiaolin Ha
> Assignee: Xiaolin Ha
> Priority: Major
> Fix For: 2.5.0, 3.0.0-alpha-3, 2.4.12
>
>
> The rate calculator should avoid negative values, e.g. if a region is moved from RS1 to RS2, the request count loads in the balancer cache maybe [100,200,0,100,200], then the region load cost calculated by CostFromRegionLoadAsRateFunction#getRegionLoadCost will be (100-200+100+100)/4=25, while the real cost is (100+0+100+200)/4=100.
> {code:java}
> protected double getRegionLoadCost(Collection<BalancerRegionLoad> regionLoadList) {
> Iterator<BalancerRegionLoad> iter = regionLoadList.iterator();
> if (!iter.hasNext()) {
> return 0;
> }
> double previous = getCostFromRl(iter.next());
> if (!iter.hasNext()) {
> return 0;
> }
> double cost = 0;
> do {
> double current = getCostFromRl(iter.next());
> cost += current - previous;
> previous = current;
> } while (iter.hasNext());
> return Math.max(0, cost / (regionLoadList.size() - 1));
> } {code}
> We should change the cost accumulate codes to,
> {code:java}
> cost += current >= previous ? current - previous : current; {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)