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

Calling Increment#addColumn on the same column multiple times produces wrong result

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      Case:
      Initially get('row1'):
      rowkey=row1 value=1
      run:
      Increment increment = new Increment(Bytes.toBytes("row1"));
      for (int i = 0; i < N; i++) {
      increment.addColumn(Bytes.toBytes("cf"), Bytes.toBytes("c"), 1)
      }
      hobi.increment(increment);

      get('row1'):
      if N=1 then result is 2 else if N>1 the result will always be 1

      Cause:
      https://issues.apache.org/jira/browse/HBASE-7114 let increment extent mutation which change familyMap from NavigableMap to List, so from client side, we can buffer many edits on the same column;
      However, HRegion#increment use idx to iterate the get's results, here results.size<family.value().size if N>1,so the latter edits on the same column won't match the condition

      {idx < results.size() && CellUtil.matchingQualifier(results.get(idx), kv) }

      , meantime the edits share the same mvccVersion ,so this case happen.

      Fix:
      according to the put/delete#add on the same column behaviour ,
      fix from server side: process "last edit wins on the same column" inside HRegion#increment to maintenance HBASE-7114's extension and keep the same result from 0.94.

      Attachments

        1. 12948-0.98.txt
          4 kB
          Ted Yu
        2. 12948-v2.patch
          4 kB
          Ted Yu
        3. 12948-v2.patch
          4 kB
          Ted Yu
        4. HBASE-12948.patch
          1 kB
          hongyu bi
        5. HBASE-12948-0.99.2-v1.patch
          3 kB
          hongyu bi
        6. HBASE-12948-v0.patch
          1 kB
          hongyu bi

        Activity

          People

            hongyu.bi hongyu bi
            hongyu.bi hongyu bi
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: