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

Memstore flush doesn't finish because of backwardseek() in memstore scanner.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1.2
    • 2.0.0, 1.2.7
    • Scanners
    • None
    • Reviewed

    Description

      Sometimes in our production hbase cluster, it takes a long time to finish memstore flush.( for about more than 30 minutes)

      the reason is that a memstore flusher thread calls StoreScanner.updateReaders(), waits for acquiring a lock that store scanner holds in StoreScanner.next() and backwardseek() in memstore scanner runs for a long time.

      I think that this condition could occur in reverse scan by the following process.

      1) create a reversed store scanner by requesting a reverse scan.
      2) flush a memstore in the same HStore.
      3) puts a lot of cells in memstore and memstore is almost full.
      4) call the reverse scanner.next() and re-create all scanners in this store because all scanners was already closed by 2)'s flush() and backwardseek() with store's lastTop for all new scanners.
      5) in this status, memstore is almost full by 2) and all cells in memstore have sequenceID greater than this scanner's readPoint because of 2)'s flush(). this condition causes searching all cells in memstore, and seekToPreviousRow() repeatly seach cells that are already searched if a row has one column. (described this in more detail in a attached file.)
      6) flush a memstore again in the same HStore, and wait until 4-5) process finished, to update store files in the same HStore after flusing.

      I searched HBase jira. and found a similar issue. (HBASE-14497) but, HBASE-14497's fix can't solve this issue because that fix just changed recursive call to loop.(and already applied to our HBase version)

      Attachments

        1. memstore_backwardSeek().PNG
          58 kB
          Jeongdae Kim
        2. HBASE-15871.branch-1.1.001.patch
          1 kB
          Jeongdae Kim
        3. HBASE-15871.branch-1.1.002.patch
          23 kB
          Jeongdae Kim
        4. HBASE-15871.branch-1.1.003.patch
          24 kB
          Jeongdae Kim
        5. HBASE-15871.patch
          7 kB
          ramkrishna.s.vasudevan
        6. HBASE-15871_1.patch
          13 kB
          ramkrishna.s.vasudevan
        7. HBASE-15871_1.patch
          13 kB
          ramkrishna.s.vasudevan
        8. HBASE-15871_2.patch
          26 kB
          ramkrishna.s.vasudevan
        9. HBASE-15871-branch-1.patch
          17 kB
          ramkrishna.s.vasudevan
        10. HBASE-15871_3.patch
          26 kB
          ramkrishna.s.vasudevan
        11. HBASE-15871_4.patch
          8 kB
          ramkrishna.s.vasudevan
        12. HBASE-15871_6.patch
          9 kB
          ramkrishna.s.vasudevan

        Issue Links

          There are no Sub-Tasks for this issue.

          Activity

            People

              ram_krish ramkrishna.s.vasudevan
              Jeongdae Kim Jeongdae Kim
              Votes:
              0 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: