Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-11041

HBaseTestingUtil.createMultiRegions deals incorrectly with missing column family

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • None
    • None
    • None
    • None

    Description

      Just found a test failing like this:

      Error Message
      
      HTableDescriptor is read-only
      
      Stacktrace
      
      java.lang.UnsupportedOperationException: HTableDescriptor is read-only
      	at org.apache.hadoop.hbase.client.UnmodifyableHTableDescriptor.addFamily(UnmodifyableHTableDescriptor.java:64)
      	at org.apache.hadoop.hbase.HBaseTestingUtility.createMultiRegions(HBaseTestingUtility.java:1302)
      	at org.apache.hadoop.hbase.HBaseTestingUtility.createMultiRegions(HBaseTestingUtility.java:1291)
      	at org.apache.hadoop.hbase.HBaseTestingUtility.createMultiRegions(HBaseTestingUtility.java:1286)
      	at org.apache.hadoop.hbase.master.TestDistributedLogSplitting.installTable(TestDistributedLogSplitting.java:485)
      	at org.apache.hadoop.hbase.master.TestDistributedLogSplitting.testMasterStartsUpWithLogSplittingWork(TestDistributedLogSplitting.java:282)
      

      The code that causes this looks like this:

          HTableDescriptor htd = table.getTableDescriptor();
          if(!htd.hasFamily(columnFamily)) {
            HColumnDescriptor hcd = new HColumnDescriptor(columnFamily);
            htd.addFamily(hcd);
          }
      

      But note that table.getTableDescriptor() returns an UnmodifyableHTableDescriptor, so the add would always fail.

      The specific test that failed was TestDistributedLogSplitting.testMasterStartsUpWithLogSplittingWork.
      Looks like the HMaster did not have the last table descriptor state, yet.

      Attachments

        Activity

          People

            Unassigned Unassigned
            larsh Lars Hofhansl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: