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

truncate_preserve should get table split keys as it is instead of converting them to string type and then again to bytes

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 0.98.0, 0.95.1, 0.99.0
    • None
    • scripts
    • None

    Description

      If we take int,long or double bytes as split keys then we are not creating table with same split keys because converting them to strings directly and to bytes is giving different split keys, sometimes getting IllegalArgument exception because of same split keys(converted). Instead we can get split keys directly from HTable and pass them while creating table.

            h_table = org.apache.hadoop.hbase.client.HTable.new(conf, table_name)
            splits = h_table.getRegionLocations().keys().map{|i| i.getStartKey} :byte
            splits = org.apache.hadoop.hbase.util.Bytes.toByteArrays(splits)
      
      Truncating 'emp3' table (it may take a while):
       - Disabling table...
       - Dropping table...
       - Creating table with region boundaries...
      
      ERROR: java.lang.IllegalArgumentException: All split keys must be unique, found duplicate: B\x11S\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD\x00\x00, B\x11S\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD\x00\x00
      
      

      Attachments

        1. HBASE-8859-Test_to_reproduce.patch
          3 kB
          rajeshbabu
        2. HBASE-8859_trunk.patch
          2 kB
          rajeshbabu
        3. HBASE-8859_trunk_4.patch
          2 kB
          rajeshbabu
        4. HBASE-8859_trunk_3.patch
          15 kB
          rajeshbabu
        5. HBASE-8859_trunk_2.patch
          2 kB
          rajeshbabu

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            rajesh23 rajeshbabu
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment