HBase
  1. HBase
  2. HBASE-5898

Consider double-checked locking for block cache lock

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.94.1
    • Fix Version/s: 0.94.3, 0.95.0
    • Component/s: Performance
    • Labels:
      None

      Description

      Running a workload with a high query rate against a dataset that fits in cache, I saw a lot of CPU being used in IdLock.getLockEntry, being called by HFileReaderV2.readBlock. Even though it was all cache hits, it was wasting a lot of CPU doing lock management here. I wrote a quick patch to switch to a double-checked locking and it improved throughput substantially for this workload.

      1. 5898-0.94.txt
        30 kB
        Lars Hofhansl
      2. 5898-TestBlocksRead.txt
        3 kB
        Ted Yu
      3. 5898-v2.txt
        6 kB
        Lars Hofhansl
      4. 5898-v3.txt
        8 kB
        Lars Hofhansl
      5. 5898-v4.txt
        30 kB
        Lars Hofhansl
      6. 5898-v4.txt
        30 kB
        Lars Hofhansl
      7. hbase-5898.txt
        2 kB
        Todd Lipcon
      8. HBASE-5898-0.patch
        6 kB
        Elliott Clark
      9. HBASE-5898-1.patch
        6 kB
        stack
      10. HBASE-5898-1.patch
        6 kB
        Elliott Clark

        Issue Links

          Activity

          Todd Lipcon created issue -
          Todd Lipcon made changes -
          Field Original Value New Value
          Attachment hbase-5898.txt [ 12525001 ]
          Ted Yu made changes -
          Attachment 5898-TestBlocksRead.txt [ 12525210 ]
          stack made changes -
          Priority Major [ 3 ] Critical [ 2 ]
          stack made changes -
          Assignee Todd Lipcon [ tlipcon ]
          Liyin Tang made changes -
          Link This issue is related to HBASE-5987 [ HBASE-5987 ]
          Elliott Clark made changes -
          Attachment HBASE-5898-0.patch [ 12550536 ]
          Lars Hofhansl made changes -
          Fix Version/s 0.94.3 [ 12323144 ]
          Fix Version/s 0.96.0 [ 12320040 ]
          Elliott Clark made changes -
          Attachment HBASE-5898-1.patch [ 12550877 ]
          Elliott Clark made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          stack made changes -
          Attachment HBASE-5898-1.patch [ 12552544 ]
          Lars Hofhansl made changes -
          Attachment 5898-v2.txt [ 12553046 ]
          Lars Hofhansl made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Lars Hofhansl made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Lars Hofhansl made changes -
          Attachment 5898-v2.txt [ 12553047 ]
          Lars Hofhansl made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Lars Hofhansl made changes -
          Attachment 5898-v2.txt [ 12553047 ]
          Lars Hofhansl made changes -
          Attachment 5898-v2.txt [ 12553046 ]
          Lars Hofhansl made changes -
          Attachment 5898-v2.txt [ 12553048 ]
          Lars Hofhansl made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Lars Hofhansl made changes -
          Attachment 5898-v3.txt [ 12553057 ]
          Lars Hofhansl made changes -
          Attachment 5898-v4.txt [ 12553215 ]
          Lars Hofhansl made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Lars Hofhansl made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Lars Hofhansl made changes -
          Attachment 5898-v4.txt [ 12553266 ]
          Lars Hofhansl made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Lars Hofhansl made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Lars Hofhansl made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Lars Hofhansl made changes -
          Attachment 5898-0.94.txt [ 12553277 ]
          Lars Hofhansl made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Lars Hofhansl made changes -
          Link This issue relates to HBASE-7160 [ HBASE-7160 ]
          Lars Hofhansl made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Lars Hofhansl made changes -
          Link This issue is related to HBASE-7336 [ HBASE-7336 ]
          stack made changes -
          Fix Version/s 0.95.0 [ 12324094 ]
          Fix Version/s 0.96.0 [ 12320040 ]
          Fix Version/s 0.94.3 [ 12323144 ]
          Lars Hofhansl made changes -
          Fix Version/s 0.94.3 [ 12323144 ]

            People

            • Assignee:
              Todd Lipcon
              Reporter:
              Todd Lipcon
            • Votes:
              0 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development