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

Failed to truncate a table while maintaing binary region boundaries

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.94.11
    • 1.0.0, 0.98.10, 1.1.0, 0.94.27
    • shell
    • None
    • Reviewed

    Description

      Binary region boundaries become wrong during
      converting byte array to normal string, and back to byte array in truncate_preserve of admin.rb, which makes the truncation of table failed.

      See: truncate_preserve method in admin.rb

       splits = h_table.getRegionLocations().keys().map{|i| Bytes.toString(i.getStartKey)}.delete_if{|k| k == ""}.to_java :String
       splits = org.apache.hadoop.hbase.util.Bytes.toByteArrays(splits)
      

      eg:

      \xFA\x00\x00\x00\x00\x00\x00\x00 ->  \xEF\xBF\xBD\x00\x00\x00\x00\x00\x00\x00
      \xFC\x00\x00\x00\x00\x00\x00\x00 -> \xEF\xBF\xBD\x00\x00\x00\x00\x00\x00\x00
      

      Simple patch is using binary string instead of normal string.

      Attachments

        1. HBASE-12801-trunk-v1.diff
          2 kB
          Shaohui Liu
        2. HBASE-12801-0.94-v1.diff
          2 kB
          Shaohui Liu

        Activity

          People

            liushaohui Shaohui Liu
            liushaohui Shaohui Liu
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: