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

Use ReadWriteLock for region scanner readpoint map

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0-alpha-3
    • 2.6.0, 3.0.0-alpha-4, 2.4.17, 2.5.4
    • Scanners
    • None

    Description

      Currently we manage the concurrency between the RegionScanner and getSmallestReadPoint by synchronizing on the scannerReadPoints object. In our production, we find that many read threads are blocked by this when we have a heavy read load. 

      we need to get smallest read point when 
      a. flush a memstore 
      b. compact memstore/storefile 
      c. do delta operation like increment/append
      Usually the frequency of these operations is much less than read requests. 

      It's a little expensive to use an exclusive lock here because for region scanners, what it need to do is just calcaulating readpoint and putting the readpoint in the scanner readpoint map, which is thread-safe. Multiple read threads can do this in parallel without synchronization.

      Based on the above consideration, maybe we can replace the synchronized lock with readwrite lock. It will help improve the read performance if the bottleneck is on the synchronization here.

      Attachments

        1. jstack-2.png
          687 kB
          ruanhui

        Activity

          People

            frostruan ruanhui
            frostruan ruanhui
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: