hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "cuijianwei (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-12759) numMaxRegionsPerTable is not updated correctly in BaseLoadBalancer.regionMoved
Date Fri, 26 Dec 2014 02:50:13 GMT

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

cuijianwei updated HBASE-12759:
-------------------------------
    Description: 
numMaxRegionsPerTable will be updated in BaseLoadBalancer.regionMoved(...) as:
{code}
    void regionMoved(int region, int oldServer, int newServer) {
      ....
      int tableIndex = regionIndexToTableIndex[region];
      if (oldServer >= 0) {
        numRegionsPerServerPerTable[oldServer][tableIndex]--;
      }
      numRegionsPerServerPerTable[newServer][tableIndex]++;

      //check whether this caused maxRegionsPerTable in the new Server to be updated
      if (numRegionsPerServerPerTable[newServer][tableIndex] > numMaxRegionsPerTable[tableIndex])
{
        numRegionsPerServerPerTable[newServer][tableIndex] = numMaxRegionsPerTable[tableIndex];
 // ==> should be: numMaxRegionsPerTable[tableIndex] = numRegionsPerServerPerTable[newServer][tableIndex];
      } else if (oldServer >= 0 && (numRegionsPerServerPerTable[oldServer][tableIndex]
+ 1)
          == numMaxRegionsPerTable[tableIndex]) {
        //recompute maxRegionsPerTable since the previous value was coming from the old server
        // ===> should reset numMaxRegionsPerTable[tableIndex] before recompute : numMaxRegionsPerTable[tableIndex]
= 0;
        for (int serverIndex = 0 ; serverIndex < numRegionsPerServerPerTable.length; serverIndex++)
{
          if (numRegionsPerServerPerTable[serverIndex][tableIndex] > numMaxRegionsPerTable[tableIndex])
{
            numMaxRegionsPerTable[tableIndex] = numRegionsPerServerPerTable[serverIndex][tableIndex];
          }
        }
      }
{code}
It seems that numMaxRegionsPerTable is not updated correctly as shown above.

  was:
numMaxRegionsPerTable will be updated in BaseLoadBalancer.regionMoved(...) as:
{code}
    void regionMoved(int region, int oldServer, int newServer) {
      ....
      int tableIndex = regionIndexToTableIndex[region];
      if (oldServer >= 0) {
        numRegionsPerServerPerTable[oldServer][tableIndex]--;
      }
      numRegionsPerServerPerTable[newServer][tableIndex]++;

      //check whether this caused maxRegionsPerTable in the new Server to be updated
      if (numRegionsPerServerPerTable[newServer][tableIndex] > numMaxRegionsPerTable[tableIndex])
{
        numRegionsPerServerPerTable[newServer][tableIndex] = numMaxRegionsPerTable[tableIndex];
 // ==> should be: numMaxRegionsPerTable[tableIndex] = numRegionsPerServerPerTable[newServer][tableIndex];
      } else if (oldServer >= 0 && (numRegionsPerServerPerTable[oldServer][tableIndex]
+ 1)
          == numMaxRegionsPerTable[tableIndex]) {
        //recompute maxRegionsPerTable since the previous value was coming from the old server
       // ===> should reset numMaxRegionsPerTable[tableIndex] by : numMaxRegionsPerTable[tableIndex]
= 0;
        for (int serverIndex = 0 ; serverIndex < numRegionsPerServerPerTable.length; serverIndex++)
{
          if (numRegionsPerServerPerTable[serverIndex][tableIndex] > numMaxRegionsPerTable[tableIndex])
{
            numMaxRegionsPerTable[tableIndex] = numRegionsPerServerPerTable[serverIndex][tableIndex];
          }
        }
      }
{code}
It seems that numMaxRegionsPerTable is not updated correctly as shown above.


> numMaxRegionsPerTable is not updated correctly in BaseLoadBalancer.regionMoved
> ------------------------------------------------------------------------------
>
>                 Key: HBASE-12759
>                 URL: https://issues.apache.org/jira/browse/HBASE-12759
>             Project: HBase
>          Issue Type: Bug
>          Components: Balancer
>    Affects Versions: 1.0.0
>            Reporter: cuijianwei
>            Priority: Minor
>         Attachments: HBASE-12759-trunk.patch
>
>
> numMaxRegionsPerTable will be updated in BaseLoadBalancer.regionMoved(...) as:
> {code}
>     void regionMoved(int region, int oldServer, int newServer) {
>       ....
>       int tableIndex = regionIndexToTableIndex[region];
>       if (oldServer >= 0) {
>         numRegionsPerServerPerTable[oldServer][tableIndex]--;
>       }
>       numRegionsPerServerPerTable[newServer][tableIndex]++;
>       //check whether this caused maxRegionsPerTable in the new Server to be updated
>       if (numRegionsPerServerPerTable[newServer][tableIndex] > numMaxRegionsPerTable[tableIndex])
{
>         numRegionsPerServerPerTable[newServer][tableIndex] = numMaxRegionsPerTable[tableIndex];
 // ==> should be: numMaxRegionsPerTable[tableIndex] = numRegionsPerServerPerTable[newServer][tableIndex];
>       } else if (oldServer >= 0 && (numRegionsPerServerPerTable[oldServer][tableIndex]
+ 1)
>           == numMaxRegionsPerTable[tableIndex]) {
>         //recompute maxRegionsPerTable since the previous value was coming from the old
server
>         // ===> should reset numMaxRegionsPerTable[tableIndex] before recompute :
numMaxRegionsPerTable[tableIndex] = 0;
>         for (int serverIndex = 0 ; serverIndex < numRegionsPerServerPerTable.length;
serverIndex++) {
>           if (numRegionsPerServerPerTable[serverIndex][tableIndex] > numMaxRegionsPerTable[tableIndex])
{
>             numMaxRegionsPerTable[tableIndex] = numRegionsPerServerPerTable[serverIndex][tableIndex];
>           }
>         }
>       }
> {code}
> It seems that numMaxRegionsPerTable is not updated correctly as shown above.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message