HBase
  1. HBase
  2. HBASE-5900

HRegion#FIXED_OVERHEAD is miscalculated in 94.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.94.0
    • Fix Version/s: 0.94.0
    • Component/s: regionserver
    • Labels:
      None

      Description

      After apply the patch of HBASE-5611, and tested on a 32-bit machine. This problem was triggered.
      Before this patch, TestHeapSize is passed by pure coincidence in 94.

        public static final long FIXED_OVERHEAD = ClassSize.align(
            ClassSize.OBJECT +
            ClassSize.ARRAY +
            30  * ClassSize.REFERENCE + Bytes.SIZEOF_INT +
            (6 * Bytes.SIZEOF_LONG) +
            Bytes.SIZEOF_BOOLEAN);
      

      Actually, there are 31 REFERENCEs and 5 LONGs in HRegion.

        Activity

        Hide
        Ted Yu added a comment -

        Fix included in the patch for HBASE-5611.

        Show
        Ted Yu added a comment - Fix included in the patch for HBASE-5611 .
        Hide
        Jieshan Bean added a comment -

        TestChangingEncoding is added just for testing FIXED_OVERHEAD. And the size of FIXED_OVERHEAD before align is needed, that's why I introduced a new variable here.
        I saw the new patch in HBASE-5611 had included this change. So this patch is not needed now.
        Thank you, Ted.

        Show
        Jieshan Bean added a comment - TestChangingEncoding is added just for testing FIXED_OVERHEAD. And the size of FIXED_OVERHEAD before align is needed, that's why I introduced a new variable here. I saw the new patch in HBASE-5611 had included this change. So this patch is not needed now. Thank you, Ted.
        Hide
        Ted Yu added a comment -

        Please keep the original indentation so that it is easy to see the changes:

        +  
        +  public static final long HREGION_CLASS_SIZE = ClassSize.OBJECT
        +      + ClassSize.ARRAY + 31 * ClassSize.REFERENCE + Bytes.SIZEOF_INT
        +      + (5 * Bytes.SIZEOF_LONG) + Bytes.SIZEOF_BOOLEAN;
        
        -  public static final long FIXED_OVERHEAD = ClassSize.align(
        -      ClassSize.OBJECT +
        -      ClassSize.ARRAY +
        -      30 * ClassSize.REFERENCE + Bytes.SIZEOF_INT +
        -      (6 * Bytes.SIZEOF_LONG) +
        -      Bytes.SIZEOF_BOOLEAN);
        

        I ran TestHeapSize with the patch and it passed.

        Let's keep the patch in minimal form with the fix to FIXED_OVERHEAD only.

        Show
        Ted Yu added a comment - Please keep the original indentation so that it is easy to see the changes: + + public static final long HREGION_CLASS_SIZE = ClassSize.OBJECT + + ClassSize.ARRAY + 31 * ClassSize.REFERENCE + Bytes.SIZEOF_INT + + (5 * Bytes.SIZEOF_LONG) + Bytes.SIZEOF_BOOLEAN; - public static final long FIXED_OVERHEAD = ClassSize.align( - ClassSize.OBJECT + - ClassSize.ARRAY + - 30 * ClassSize.REFERENCE + Bytes.SIZEOF_INT + - (6 * Bytes.SIZEOF_LONG) + - Bytes.SIZEOF_BOOLEAN); I ran TestHeapSize with the patch and it passed. Let's keep the patch in minimal form with the fix to FIXED_OVERHEAD only.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12525053/HRegion-FIEED_OVERHEAD.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        -1 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/1688//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12525053/HRegion-FIEED_OVERHEAD.patch against trunk revision . +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/1688//console This message is automatically generated.
        Hide
        Jieshan Bean added a comment -

        Patch will be uploaded after full tests today.

        Show
        Jieshan Bean added a comment - Patch will be uploaded after full tests today.

          People

          • Assignee:
            Jieshan Bean
            Reporter:
            Jieshan Bean
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development