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

Adjacent column with timestamp=0 marked for deletion inadvertently

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.92.1
    • Fix Version/s: None
    • Component/s: Deletes
    • Labels:
    • Environment:

      Ubuntu 10.04.2 LTS
      2.6.32-28-server #55-Ubuntu SMP Mon Jan 10 23:57:16 UTC 2011 x86_64 GNU/Linux
      Cloudera distro 0.92.1-cdh4.1.2

      Description

      This is an esoteric issue that I ran into. We're using binary arrays for column names and "compact" the columns from old rows into a single column to reduce storage usage. The column names are concatenated to create the new qualifier. On accident, I was setting the timestamp to 0 when storing the concatenated column. When I went to delete the old columns, the concatenated column with a timestamp of 0 was also deleted when it should not have been.

      Here are some of the columns in the row (taken from the shell utility)

      hbase(main):002:0> get 'mytable', "\x00\x01\xAA\x50\x8E\xC4\x20\x00\x00\x01\x00\x00\xAC"
      COLUMN CELL
      t:\x00\x17 timestamp=1351533601998, value=\x00\x00\x00\x00O\xB2\xDC[
      t:\x00\x17\x03\xD7\x...(long name) timestamp=0, value=\x00\x00\x... lots of binary data....
      t:\x03\xD7 timestamp=1351533661458, value=\x00\x00\x00\x00O\xB9\xD1\xE5
      t:\x07\x97 timestamp=1351533721758, value=\x00\x00\x00\x00O\xBC#\xD0
      t:\x0BW timestamp=1351533781738, value=\x00\x00\x00\x00O\xBD\xB93

      I wanted to delete the column “t:\x00\x17” but every time I did, the column “t:\x00\x17\x03\xD7\x...” would also be deleted so that I’d wind up with:

      hbase(main):005:0> get 'mytable', "\x00\x01\xAA\x50\x8E\xC4\x20\x00\x00\x01\x00\x00\xAC"
      COLUMN CELL
      t:\x03\xD7 timestamp=1351533661458, value=\x00\x00\x00\x00O\xB9\xD1\xE5
      t:\x07\x97 timestamp=1351533721758, value=\x00\x00\x00\x00O\xBC#\xD0
      t:\x0BW timestamp=1351533781738, value=\x00\x00\x00\x00O\xBD\xB93

      My JAVA test code for the delete looked like this:

      HTableInterface table = factory.createHTableInterface(config, "mytable".getBytes());
      Delete delete = new Delete(HexToBytes("0001AA508EC4200000010000AC"));
      delete.deleteColumn("t".getBytes(), new byte[]

      { (byte) 0x00, (byte) 0x17 }

      );
      table.delete(delete);

      Setting a positive timestamp for the concatenated field solved my issue, but if someone else wants to use timestamps of 0, they may run into the same problem.

      NOTE: I also ran into the problem on hbase-0.90.4-cdh3u3

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              manolamancha Chris Larsen
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: