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

Increment data will be lost when the memstore is flushed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.94.1, 0.95.0
    • regionserver
    • None
    • Reviewed

    Description

      There are two problems in increment() now:
      First:
      I see that the timestamp(the variable now) in HRegion's Increment() is generated before got the rowLock, so when there are multi-thread increment the same row, although it generate earlier, it may got the lock later. Because increment just store one version, so till now, the result will still be right.

      When the region is flushing, these increment will read the kv from snapshot and memstore with whose timestamp is larger, and write it back to memstore. If the snapshot's timestamp larger than the memstore, the increment will got the old data and then do the increment, it's wrong.

      Secondly:
      Also there is a risk in increment. Because it writes the memstore first and then HLog, so if it writes HLog failed, the client will also read the incremented value.

      Attachments

        1. 6195.addendum
          0.8 kB
          Ted Yu
        2. 6195-trunk-V7.patch
          7 kB
          Ted Yu
        3. HBASE-6195-trunk.patch
          2 kB
          ShiXing
        4. HBASE-6195-trunk-V2.patch
          3 kB
          ShiXing
        5. HBASE-6195-trunk-V3.patch
          3 kB
          ShiXing
        6. HBASE-6195-trunk-V4.patch
          3 kB
          ShiXing
        7. HBASE-6195-trunk-V5.patch
          7 kB
          ShiXing
        8. HBASE-6195-trunk-V6.patch
          7 kB
          ShiXing

        Issue Links

          Activity

            People

              xingshi ShiXing
              shixing ShiXing
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: