HBase
  1. HBase
  2. HBASE-4384

Hard to tell what causes failure in CloseRegionHandler#getCurrentVersion

    Details

    • Type: Task Task
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.90.0
    • Fix Version/s: 0.90.5
    • Component/s: Zookeeper
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The current code goes like:

      172    * Get the node's current version
      173    * @return The expectedVersion.  If -1, we failed getting the node
      174    */
      175   private int getCurrentVersion() {
      176     int expectedVersion = FAILED;
      177     try {
      178       if ((expectedVersion = ZKAssign.getVersion(
      179           server.getZooKeeper(), regionInfo)) == FAILED) {
      180         LOG.warn("Error getting node's version in CLOSING state," +
      181           " aborting close of " + regionInfo.getRegionNameAsString());
      182       }
      183     } catch (KeeperException e) {
      184       LOG.warn("Error creating node in CLOSING state, aborting close of " +
      185         regionInfo.getRegionNameAsString());
      186     }
      187     return expectedVersion;
      188   }
      189 }
      

      Both WARN cases would be identical this way. In case of an exception, I think an exception ought to be logged as well.

        Activity

        Harsh J created issue -
        Hide
        Harsh J added a comment -

        Ah, this isn't a problem on trunk. The method appears to have been refactored.

        Show
        Harsh J added a comment - Ah, this isn't a problem on trunk. The method appears to have been refactored.
        Harsh J made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Not A Problem [ 8 ]
        Hide
        Harsh J added a comment -

        Mehh... Confusions.

        Show
        Harsh J added a comment - Mehh... Confusions.
        Harsh J made changes -
        Resolution Not A Problem [ 8 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Harsh J added a comment -

        (Updated topic comment/desc.)

        Show
        Harsh J added a comment - (Updated topic comment/desc.)
        Harsh J made changes -
        Summary Hard to tell what causes failure in ZKAssign#createNodeClosing Hard to tell what causes failure in CloseRegionHandler#getCurrentVersion
        Description The current code goes like:

        {code}
        467 public static int createNodeClosing(ZooKeeperWatcher zkw, HRegionInfo region,
        468 String serverName)
        469 throws KeeperException, KeeperException.NodeExistsException {
        470 LOG.debug(zkw.prefix("Creating unassigned node for " +
        471 region.getEncodedName() + " in a CLOSING state"));
        472
        473 RegionTransitionData data = new RegionTransitionData(
        474 EventType.RS_ZK_REGION_CLOSING, region.getRegionName(), serverName);
        475
        476 synchronized (zkw.getNodes()) {
        477 String node = getNodeName(zkw, region.getEncodedName());
        478 zkw.getNodes().add(node);
        479 return ZKUtil.createAndWatch(zkw, node, data.getBytes());
        480 }
        481 }
        {code}

        Both WARN cases would be identical this way. In case of an exception, I think an exception ought to be logged as well.
        The current code goes like:

        {code}
        172 * Get the node's current version
        173 * @return The expectedVersion. If -1, we failed getting the node
        174 */
        175 private int getCurrentVersion() {
        176 int expectedVersion = FAILED;
        177 try {
        178 if ((expectedVersion = ZKAssign.getVersion(
        179 server.getZooKeeper(), regionInfo)) == FAILED) {
        180 LOG.warn("Error getting node's version in CLOSING state," +
        181 " aborting close of " + regionInfo.getRegionNameAsString());
        182 }
        183 } catch (KeeperException e) {
        184 LOG.warn("Error creating node in CLOSING state, aborting close of " +
        185 regionInfo.getRegionNameAsString());
        186 }
        187 return expectedVersion;
        188 }
        189 }
        {code}

        Both WARN cases would be identical this way. In case of an exception, I think an exception ought to be logged as well.
        Harsh J made changes -
        Attachment HBASE-4384.r1.diff [ 12494204 ]
        Harsh J made changes -
        Status Reopened [ 4 ] Patch Available [ 10002 ]
        Hide
        stack added a comment -

        @Harsh So the patch is for 0.90 branch?

        Show
        stack added a comment - @Harsh So the patch is for 0.90 branch?
        Hide
        Harsh J added a comment -

        stack, No, patch is for all branches 0.90 to trunk. Please disregard my first comment, it was made when I was under a great deal of workspace switching and I thought I was looking at one snippet of trunk source, while I was looking at something else instead.

        This patch is targeted for trunk, but can also be backported atop other branches (0.92 if branched already, and 0.90).

        Show
        Harsh J added a comment - stack, No, patch is for all branches 0.90 to trunk. Please disregard my first comment, it was made when I was under a great deal of workspace switching and I thought I was looking at one snippet of trunk source, while I was looking at something else instead. This patch is targeted for trunk, but can also be backported atop other branches (0.92 if branched already, and 0.90).
        Hide
        stack added a comment -

        Committed branch and trunk. Thanks for the patch Harsh.

        Show
        stack added a comment - Committed branch and trunk. Thanks for the patch Harsh.
        stack made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags [Reviewed]
        Fix Version/s 0.90.5 [ 12317145 ]
        Fix Version/s 0.94.0 [ 12316419 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in HBase-TRUNK #2206 (See https://builds.apache.org/job/HBase-TRUNK/2206/)
        HBASE-4384 Hard to tell what causes failure in CloseRegionHandler#getCurrentVersion

        stack :
        Files :

        • /hbase/trunk/CHANGES.txt
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java
        Show
        Hudson added a comment - Integrated in HBase-TRUNK #2206 (See https://builds.apache.org/job/HBase-TRUNK/2206/ ) HBASE-4384 Hard to tell what causes failure in CloseRegionHandler#getCurrentVersion stack : Files : /hbase/trunk/CHANGES.txt /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java
        stack made changes -
        Fix Version/s 0.90.6 [ 12319200 ]
        Fix Version/s 0.90.5 [ 12317145 ]
        stack made changes -
        Fix Version/s 0.90.5 [ 12317145 ]
        Fix Version/s 0.90.6 [ 12319200 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1m 28s 1 Harsh J 13/Sep/11 11:02
        Resolved Resolved Reopened Reopened
        1m 3s 1 Harsh J 13/Sep/11 11:03
        Reopened Reopened Patch Available Patch Available
        6m 18s 1 Harsh J 13/Sep/11 11:10
        Patch Available Patch Available Resolved Resolved
        11h 1m 1 stack 13/Sep/11 22:11

          People

          • Assignee:
            Harsh J
            Reporter:
            Harsh J
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development