HBase
  1. HBase
  2. HBASE-4420

MasterObserver preMove() and postMove() should throw IOException instead of UnknownRegionException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.92.0
    • Component/s: Coprocessors
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      We've standardized on IOException as the main way for coprocessors to communicate errors back out of the Observer hooks. All Observer hooks throw IOE except for MasterObserver.preMove() and MasterObserver.postMove(), which throw UnknownRegionException, since that's what HMasterInterface.move() declares. In hindsight, making these two MasterObserver methods inconsistent seems like a mistake.

      I think we should change MasterObserver.preMove() and MasterObserver.postMove() to throw IOException for consistency with the other methods. We could deprecate the existing HMasterInterface.move() method to have it switch over to throwing IOException as well, but this would require creating a version with a new name, which seems unnecessarily ugly. So I'd suggest we just have HMaster.move() handle the IOException and use it to init an UnknownRegionException. Wonky as that is, it seems the lesser evil.

      1. HBASE-4420.patch
        6 kB
        Gary Helmling

        Issue Links

          Activity

          Hide
          Hudson added a comment -

          Integrated in HBase-TRUNK #2223 (See https://builds.apache.org/job/HBase-TRUNK/2223/)
          HBASE-4420 MasterObserver preMove() and postMove() should throw IOException

          garyh :
          Files :

          • /hbase/trunk/CHANGES.txt
          • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java
          • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java
          • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
          • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/MasterCoprocessorHost.java
          • /hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java
          Show
          Hudson added a comment - Integrated in HBase-TRUNK #2223 (See https://builds.apache.org/job/HBase-TRUNK/2223/ ) HBASE-4420 MasterObserver preMove() and postMove() should throw IOException garyh : Files : /hbase/trunk/CHANGES.txt /hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/MasterCoprocessorHost.java /hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java
          Hide
          Gary Helmling added a comment -

          Committed to trunk. Thanks for review, Ted and Stack.

          Show
          Gary Helmling added a comment - Committed to trunk. Thanks for review, Ted and Stack.
          Hide
          stack added a comment -

          +1

          Show
          stack added a comment - +1
          Hide
          Ted Yu added a comment -

          +1 on patch.

          Show
          Ted Yu added a comment - +1 on patch.
          Hide
          Gary Helmling added a comment -

          Patch changing preMove() and postMove() to throw IOException and changing HMaster.move() to catch and propogate an IOE back out in a dummy UnknownRegionException.

          Show
          Gary Helmling added a comment - Patch changing preMove() and postMove() to throw IOException and changing HMaster.move() to catch and propogate an IOE back out in a dummy UnknownRegionException.
          Hide
          stack added a comment -

          +1

          Show
          stack added a comment - +1
          Hide
          Ted Yu added a comment -

          +1 on the proposed approach.

          Show
          Ted Yu added a comment - +1 on the proposed approach.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development