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

Small scanners (with particular configurations) do not return all rows

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.0.0, 1.1.0, 0.98.13, 2.0.0
    • 1.0.1, 1.1.0, 0.98.12, 2.0.0
    • None
    • None
    • Reviewed

    Description

      I recently ran into a couple data loss issues with small scans. Similar to HBASE-13262, these issues only appear when scans are configured in such a way that the max result size limit is reached before the caching limit is reached. As far as I can tell, this issue affects branches 0.98+

      I should note that after investigation it looks like the root cause of these issues is not the same as HBASE-13262. Rather, these issue are caused by errors in the small scanner logic (I will explain in more depth below).

      Furthermore, I do know that the solution from HBASE-13262 has not made its way into small scanners (it is being addressed in HBASE-13335). As a result I made sure to test these issues with the patch from HBASE-13335 applied and I saw that they were still present.

      The following two issues have been observed (both lead to data loss):

      1. When a small scan is configured with a caching value of Integer.MAX_VALUE, and a maxResultSize limit that is reached before the region is exhausted, integer overflow will occur. This eventually leads to a preemptive skip of the regions.

      2. When a small scan is configured with a maxResultSize that is smaller than the size of a single row, the small scanner will jump between regions preemptively. This issue seems to be because small scanners assume that, unless a region is exhausted, at least 2 rows will be returned from the server. This assumption isn't clearly state in the small scanners but is implied through the use of skipRowOfFirstResult.

      Again, I would like to stress that the root cause of these issues is NOT related to the cause of HBASE-13262. These issues occur because of inappropriate assumption made in the small scanner logic. The inappropriate assumptions are:
      1. Integer overflow will not occur when incrementing caching
      2. At least 2 rows will be returned from the server unless the region has been exhausted

      I am attaching a patch that contains tests to display these issues. If these issues should be split into separate JIRAs please let me know.

      Attachments

        1. small-scanner-data-loss-tests-branch-1.0+.patch
          7 kB
          Jonathan Lawlor
        2. small-scanner-data-loss-tests-0.98.patch
          7 kB
          Jonathan Lawlor
        3. HBASE-13374-v1.patch
          10 kB
          Jonathan Lawlor
        4. HBASE-13374-v1.patch
          10 kB
          Jonathan Lawlor
        5. HBASE-13374-v1.patch
          10 kB
          Jonathan Lawlor
        6. HBASE-13374-v1.patch
          10 kB
          Jonathan Lawlor
        7. HBASE-13374-v1.patch
          10 kB
          Michael Stack
        8. HBASE-13374-v1-0.98.patch
          10 kB
          Enis Soztutar

        Activity

          People

            jonathan.lawlor Jonathan Lawlor
            jonathan.lawlor Jonathan Lawlor
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: