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

CheckAndPut doesn't work when value is empty byte[]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.92.0
    • 0.92.1, 0.94.0
    • None
    • None
    • Reviewed

    Description

      When a value contains an empty byte[] and then a checkAndPut is performed with an empty byte[] , the operation will fail.

      For example:
      Put put = new Put(row1);
      put.add(fam1, qf1, new byte[0]);
      table.put(put);

      put = new Put(row1);
      put.add(fam1, qf1, val1);
      table.checkAndPut(row1, fam1, qf1, new byte[0], put); ---> false

      I think this is related to HBASE-3793 and HBASE-3468.

      Note that you will also get into this situation when first putting a null value ( put.add(fam1,qf1,null) ), as this value will then be regarded and returned as an empty byte[] upon a get.

      Attachments

        1. checkAndMutateEmpty-HBASE-5345.patch
          2 kB
          Evert Arckens
        2. 5345-v2.txt
          2 kB
          Ted Yu
        3. 5345.txt
          2 kB
          Ted Yu

        Activity

          People

            evertot Evert Arckens
            evertot Evert Arckens
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: