hbase-issues mailing list archives

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

             Summary: 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


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.



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

Mime
View raw message