Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 95AF3172BA for ; Thu, 8 Jan 2015 08:07:34 +0000 (UTC) Received: (qmail 103 invoked by uid 500); 8 Jan 2015 08:07:35 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 99951 invoked by uid 500); 8 Jan 2015 08:07:35 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 99934 invoked by uid 99); 8 Jan 2015 08:07:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jan 2015 08:07:35 +0000 Date: Thu, 8 Jan 2015 08:07:35 +0000 (UTC) From: "Cosmin Lehene (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HBASE-6760) HMaster.balance() returns 'true' even if rebalancing plan is empty and the balancer does not run MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-6760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Cosmin Lehene resolved HBASE-6760. ---------------------------------- Resolution: Invalid Closing as "invalid" please see previous comments. > HMaster.balance() returns 'true' even if rebalancing plan is empty and the balancer does not run > ------------------------------------------------------------------------------------------------ > > Key: HBASE-6760 > URL: https://issues.apache.org/jira/browse/HBASE-6760 > Project: HBase > Issue Type: Bug > Components: master > Reporter: Aditya Kishore > Assignee: Aditya Kishore > Priority: Minor > > The issue seems to exists due to oversight during the rewrite. In line 1289, the variable 'plans' is created as a 'new ArrayList()' and then in line 1298, balancerRan is calculated as (plans != null) which for obvious reason, will always return true. > {code:title=HMaster.java (trunk:1383496)} > .... > 1289 List plans = new ArrayList(); > 1290 //Give the balancer the current cluster state. > 1291 this.balancer.setClusterStatus(getClusterStatus()); > 1292 for (Map> assignments : assignmentsByTable.values()) { > 1293 List partialPlans = this.balancer.balanceCluster(assignments); > 1294 if (partialPlans != null) plans.addAll(partialPlans); > 1295 } > 1296 int rpCount = 0; // number of RegionPlans balanced so far > 1297 long totalRegPlanExecTime = 0; > 1298 balancerRan = plans != null; > 1299 if (plans != null && !plans.isEmpty()) { > .... > {code} > A simple fix is to initialize 'balancerRan' to 'false', remove "balancerRan = plans != null" and add "balancerRan = true" after "if (plans != null && !plans.isEmpty()) {". > However, a question remains that should we call "this.cpHost.postBalance();" if the balancer did not run at this point? > I'll attach the patch shortly if I get a confirmation on this. -- This message was sent by Atlassian JIRA (v6.3.4#6332)