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

Speedup IdLock

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Abandoned
    • 1.0.1, 1.1.0, 0.98.13, 2.0.0
    • None
    • regionserver
    • None

    Description

      while testing the read path, I ended up with the profiler showing a lot of time spent in IdLock.
      The IdLock is used by the HFileReader and the BucketCache, so you'll see a lot of it when you have an hotspot on a hfile.
      we end up locked by that synchronized() and with too many calls to map.putIfAbsent()

      public Entry getLockEntry(long id) throws IOException {
        while ((existing = map.putIfAbsent(entry.id, entry)) != null) {
          synchronized (existing) {
            ...
          }
          // If the entry is not locked, it might already be deleted from the
          // map, so we cannot return it. We need to get our entry into the map
          // or get someone else's locked entry.
        }
      }
      
      public void releaseLockEntry(Entry entry) {
        synchronized (entry) {
          ...
        }
      }
      

      Attachments

        1. IdLockPerf.java
          1 kB
          Matteo Bertozzi
        2. HBASE-13903-v0.patch
          5 kB
          Matteo Bertozzi

        Activity

          People

            Unassigned Unassigned
            mbertozzi Matteo Bertozzi
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: