You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Tianying Chang (JIRA)" <ji...@apache.org> on 2012/10/29 19:36:12 UTC

[jira] [Created] (HBASE-7061) region balance algorithm should do "contiue" instead of "break" when calculating the underloaded server

Tianying Chang created HBASE-7061:
-------------------------------------

             Summary: region balance algorithm should do "contiue" instead of "break" when calculating the underloaded server
                 Key: HBASE-7061
                 URL: https://issues.apache.org/jira/browse/HBASE-7061
             Project: HBase
          Issue Type: Bug
            Reporter: Tianying Chang
            Assignee: Tianying Chang


I found this issue when investigating HBASE-7060. Basically, I think  the intention of this code below is to find all the underloaded server. By using break, it will exit earlier, depending on where the non-overloaded server show up in the list.  "break" should be changed to "continue". 

Map<ServerName, Integer> underloadedServers = new HashMap<ServerName, Integer>();
for (Map.Entry<ServerAndLoad, List<HRegionInfo>> server:
serversByLoad.entrySet()) {
int regionCount = server.getKey().getLoad();
if (regionCount >= min) { break; }
underloadedServers.put(server.getKey().getServerName(), min - regionCount);
}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (HBASE-7061) region balance algorithm should do "contiue" instead of "break" when calculating the underloaded server

Posted by "Tianying Chang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-7061?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tianying Chang resolved HBASE-7061.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.92.3

the fix is in the same patch as the related bug. 
                
> region balance algorithm should do "contiue" instead of "break" when calculating the underloaded server
> -------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-7061
>                 URL: https://issues.apache.org/jira/browse/HBASE-7061
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Tianying Chang
>            Assignee: Tianying Chang
>             Fix For: 0.92.3
>
>
> I found this issue when investigating HBASE-7060. Basically, I think  the intention of this code below is to find all the underloaded server. By using break, it will exit earlier, depending on where the non-overloaded server show up in the list.  "break" should be changed to "continue". 
> Map<ServerName, Integer> underloadedServers = new HashMap<ServerName, Integer>();
> for (Map.Entry<ServerAndLoad, List<HRegionInfo>> server:
> serversByLoad.entrySet()) {
> int regionCount = server.getKey().getLoad();
> if (regionCount >= min) { break; }
> underloadedServers.put(server.getKey().getServerName(), min - regionCount);
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-7061) region balance algorithm should do "contiue" instead of "break" when calculating the underloaded server

Posted by "Tianying Chang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-7061?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tianying Chang updated HBASE-7061:
----------------------------------


I feel that the bug is different from HBASE-7060, so I opened this bug seperately. But I will put the fix in the same patch at HBASE-7060, if approved. 
                
> region balance algorithm should do "contiue" instead of "break" when calculating the underloaded server
> -------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-7061
>                 URL: https://issues.apache.org/jira/browse/HBASE-7061
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Tianying Chang
>            Assignee: Tianying Chang
>
> I found this issue when investigating HBASE-7060. Basically, I think  the intention of this code below is to find all the underloaded server. By using break, it will exit earlier, depending on where the non-overloaded server show up in the list.  "break" should be changed to "continue". 
> Map<ServerName, Integer> underloadedServers = new HashMap<ServerName, Integer>();
> for (Map.Entry<ServerAndLoad, List<HRegionInfo>> server:
> serversByLoad.entrySet()) {
> int regionCount = server.getKey().getLoad();
> if (regionCount >= min) { break; }
> underloadedServers.put(server.getKey().getServerName(), min - regionCount);
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-7061) region balance algorithm should do "contiue" instead of "break" when calculating the underloaded server

Posted by "Sergey Shelukhin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-7061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492080#comment-13492080 ] 

Sergey Shelukhin commented on HBASE-7061:
-----------------------------------------

I think the intent is that serversByLoad entries are sorted in ascending order by load (it's a TreeMap and ServerAndLoad first compares load), therefore it adds entries until it finds the first server over the boundary. So it should be correct... Do you see specific problem because of this code?
                
> region balance algorithm should do "contiue" instead of "break" when calculating the underloaded server
> -------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-7061
>                 URL: https://issues.apache.org/jira/browse/HBASE-7061
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Tianying Chang
>            Assignee: Tianying Chang
>
> I found this issue when investigating HBASE-7060. Basically, I think  the intention of this code below is to find all the underloaded server. By using break, it will exit earlier, depending on where the non-overloaded server show up in the list.  "break" should be changed to "continue". 
> Map<ServerName, Integer> underloadedServers = new HashMap<ServerName, Integer>();
> for (Map.Entry<ServerAndLoad, List<HRegionInfo>> server:
> serversByLoad.entrySet()) {
> int regionCount = server.getKey().getLoad();
> if (regionCount >= min) { break; }
> underloadedServers.put(server.getKey().getServerName(), min - regionCount);
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-7061) region balance algorithm should do "contiue" instead of "break" when calculating the underloaded server

Posted by "Tianying Chang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-7061?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tianying Chang updated HBASE-7061:
----------------------------------


yes, it missed underloaded servers. This fix has been put int the same patch as the other bug for another region balance bug. The patch has been integrated by Ted. 
                
> region balance algorithm should do "contiue" instead of "break" when calculating the underloaded server
> -------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-7061
>                 URL: https://issues.apache.org/jira/browse/HBASE-7061
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Tianying Chang
>            Assignee: Tianying Chang
>
> I found this issue when investigating HBASE-7060. Basically, I think  the intention of this code below is to find all the underloaded server. By using break, it will exit earlier, depending on where the non-overloaded server show up in the list.  "break" should be changed to "continue". 
> Map<ServerName, Integer> underloadedServers = new HashMap<ServerName, Integer>();
> for (Map.Entry<ServerAndLoad, List<HRegionInfo>> server:
> serversByLoad.entrySet()) {
> int regionCount = server.getKey().getLoad();
> if (regionCount >= min) { break; }
> underloadedServers.put(server.getKey().getServerName(), min - regionCount);
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira