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

Eliminate use of ReadWriteLock in RegionObserver coprocessor invocation

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.92.0
    • Component/s: Coprocessors
    • Labels:
      None

      Description

      Follow-up to a discussion on the dev list: http://search-hadoop.com/m/jOovV1uAJBP

      The CoprocessorHost ReentrantReadWriteLock is imposing some overhead on data read/write operations, even when no coprocessors are loaded. Currently execution of RegionCoprocessorHost pre/postXXX() methods are guarded by acquiring the coprocessor read lock. This is used to prevent coprocessor registration from modifying the coprocessor collection while upcall hooks are in progress.

      On further discussion, and looking at the locking in HRegion, it should be sufficient to just use a CopyOnWriteArrayList for the coprocessor collection. We can then remove the coprocessor lock and eliminate the associated overhead without having to special case the "no loaded coprocessors" condition.

      1. HBASE-3587.patch
        72 kB
        Gary Helmling

        Activity

        Hide
        lars_francke Lars Francke added a comment -

        This issue was closed as part of a bulk closing operation on 2015-11-20. All issues that have been resolved and where all fixVersions have been released have been closed (following discussions on the mailing list).

        Show
        lars_francke Lars Francke added a comment - This issue was closed as part of a bulk closing operation on 2015-11-20. All issues that have been resolved and where all fixVersions have been released have been closed (following discussions on the mailing list).
        Hide
        hudson Hudson added a comment -

        Integrated in HBase-TRUNK #1836 (See https://hudson.apache.org/hudson/job/HBase-TRUNK/1836/)

        Show
        hudson Hudson added a comment - Integrated in HBase-TRUNK #1836 (See https://hudson.apache.org/hudson/job/HBase-TRUNK/1836/ )
        Hide
        ghelmling Gary Helmling added a comment -

        Committed to trunk

        Show
        ghelmling Gary Helmling added a comment - Committed to trunk
        Hide
        ghelmling Gary Helmling added a comment -

        Patch committed to trunk

        Show
        ghelmling Gary Helmling added a comment - Patch committed to trunk
        Hide
        stack stack added a comment -

        +1

        Nice one Gary.

        Show
        stack stack added a comment - +1 Nice one Gary.
        Hide
        ghelmling Gary Helmling added a comment -

        Posted patch for review at: https://review.cloudera.org/r/1681/

        Show
        ghelmling Gary Helmling added a comment - Posted patch for review at: https://review.cloudera.org/r/1681/
        Hide
        mingjielai Mingjie Lai added a comment -

        stack.
        It's been in trunk for a while. Do you see the crazy-CPU-burning recently? From unit tests or at a cluster?

        Show
        mingjielai Mingjie Lai added a comment - stack. It's been in trunk for a while. Do you see the crazy-CPU-burning recently? From unit tests or at a cluster?
        Hide
        stack stack added a comment -

        Thanks for filing this Gary. TRUNK seems broke. Its burning CPU like crazy. Perhaps it is this issue?

        Show
        stack stack added a comment - Thanks for filing this Gary. TRUNK seems broke. Its burning CPU like crazy. Perhaps it is this issue?
        Hide
        ryanobjc ryan rawson added a comment -

        +1
        http://search-hadoop.com/m/jOovV1uAJBP
        data read/write operations, even when no coprocessors are loaded. Currently
        execution of RegionCoprocessorHost pre/postXXX() methods are guarded by
        acquiring the coprocessor read lock. This is used to prevent coprocessor
        registration from modifying the coprocessor collection while upcall hooks
        are in progress.
        sufficient to just use a CopyOnWriteArrayList for the coprocessor
        collection. We can then remove the coprocessor lock and eliminate the
        associated overhead without having to special case the "no loaded
        coprocessors" condition.

        Show
        ryanobjc ryan rawson added a comment - +1 http://search-hadoop.com/m/jOovV1uAJBP data read/write operations, even when no coprocessors are loaded. Currently execution of RegionCoprocessorHost pre/postXXX() methods are guarded by acquiring the coprocessor read lock. This is used to prevent coprocessor registration from modifying the coprocessor collection while upcall hooks are in progress. sufficient to just use a CopyOnWriteArrayList for the coprocessor collection. We can then remove the coprocessor lock and eliminate the associated overhead without having to special case the "no loaded coprocessors" condition.

          People

          • Assignee:
            ghelmling Gary Helmling
            Reporter:
            ghelmling Gary Helmling
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development