You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "stack (JIRA)" <ji...@apache.org> on 2009/08/04 22:29:14 UTC

[jira] Created: (HBASE-1745) [tools] Tool to kick region out of inTransistion

[tools] Tool to kick region out of inTransistion
------------------------------------------------

                 Key: HBASE-1745
                 URL: https://issues.apache.org/jira/browse/HBASE-1745
             Project: Hadoop HBase
          Issue Type: Bug
            Reporter: stack


It seems fairly easy getting a region stuck "inTransitions" (See recent filings of mine).  Also, with addition to ClusterStatus of intransitions content, you can see this state now when you do analysis.  I want to roll RC2.  0.20.0 still has issues and we even know now what the worst of them are but the fixes can wait till 0.20.1.  Meantime, I need a means of bumping stuff that is stuck from the intransistions....  for 0.20.0 release in case we trip over this scenario for then we can effect a repair at least.  Otherwise, requires restart of cluster.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HBASE-1745) [tools] Tool to kick region out of inTransistion

Posted by "Jean-Daniel Cryans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Daniel Cryans reassigned HBASE-1745:
-----------------------------------------

    Assignee: stack

> [tools] Tool to kick region out of inTransistion
> ------------------------------------------------
>
>                 Key: HBASE-1745
>                 URL: https://issues.apache.org/jira/browse/HBASE-1745
>             Project: Hadoop HBase
>          Issue Type: Bug
>            Reporter: stack
>            Assignee: stack
>             Fix For: 0.20.0
>
>
> It seems fairly easy getting a region stuck "inTransitions" (See recent filings of mine).  Also, with addition to ClusterStatus of intransitions content, you can see this state now when you do analysis.  I want to roll RC2.  0.20.0 still has issues and we even know now what the worst of them are but the fixes can wait till 0.20.1.  Meantime, I need a means of bumping stuff that is stuck from the intransistions....  for 0.20.0 release in case we trip over this scenario for then we can effect a repair at least.  Otherwise, requires restart of cluster.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-1745) [tools] Tool to kick region out of inTransistion

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739149#action_12739149 ] 

stack commented on HBASE-1745:
------------------------------

@ryan Yes.  Didn't think of that one.  It would work too.

> [tools] Tool to kick region out of inTransistion
> ------------------------------------------------
>
>                 Key: HBASE-1745
>                 URL: https://issues.apache.org/jira/browse/HBASE-1745
>             Project: Hadoop HBase
>          Issue Type: Bug
>            Reporter: stack
>             Fix For: 0.20.0
>
>
> It seems fairly easy getting a region stuck "inTransitions" (See recent filings of mine).  Also, with addition to ClusterStatus of intransitions content, you can see this state now when you do analysis.  I want to roll RC2.  0.20.0 still has issues and we even know now what the worst of them are but the fixes can wait till 0.20.1.  Meantime, I need a means of bumping stuff that is stuck from the intransistions....  for 0.20.0 release in case we trip over this scenario for then we can effect a repair at least.  Otherwise, requires restart of cluster.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-1745) [tools] Tool to kick region out of inTransistion

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739143#action_12739143 ] 

stack commented on HBASE-1745:
------------------------------

Here is minimally invasive change.  Do close_region on the problematic region.  Add clearing from intransition if its present.  Also if no servername in the .META. info, return... rather than NPE:

{code
Index: src/java/org/apache/hadoop/hbase/master/HMaster.java
===================================================================
--- src/java/org/apache/hadoop/hbase/master/HMaster.java        (revision 800936)
+++ src/java/org/apache/hadoop/hbase/master/HMaster.java        (working copy)
@@ -1025,6 +1025,11 @@
         servername = 
           Bytes.toString(rr.getValue(CATALOG_FAMILY, SERVER_QUALIFIER));
       }
+      // Take region out of the intransistions in case it got stuck there doing
+      // an open or whatever.
+      this.regionManager.clearFromInTransition(regionname);
+      // If servername is still null, then none, exit.
+      if (servername == null) break;
       // Need to make up a HServerInfo 'servername' for that is how
       // items are keyed in regionmanager Maps.
       HServerAddress addr = new HServerAddress(servername);
Index: src/java/org/apache/hadoop/hbase/master/RegionManager.java
===================================================================
--- src/java/org/apache/hadoop/hbase/master/RegionManager.java  (revision 800936)
+++ src/java/org/apache/hadoop/hbase/master/RegionManager.java  (working copy)
@@ -1436,6 +1436,26 @@
     return result;
   }
 
+  /**
+   * @param regionname Name to clear from regions in transistion.
+   * @return True if we removed an element for the passed regionname.
+   */
+  boolean clearFromInTransition(final byte [] regionname) {
+    boolean result = false;
+    synchronized (this.regionsInTransition) {
+      if (this.regionsInTransition.isEmpty()) return result;
+      for (Map.Entry<String, RegionState> e: this.regionsInTransition.entrySet()) {
+        if (Bytes.equals(regionname, e.getValue().getRegionName())) {
+          this.regionsInTransition.remove(e.getKey());
+          LOG.debug("Removed " + e.getKey() + ", " + e.getValue());
+          result = true;
+          break;
+        }
+      }
+    }
+    return result;
+  }
+
   /*
    * State of a Region as it transitions from closed to open, etc.  See
    * note on regionsInTransition data member above for listing of state
{code}

> [tools] Tool to kick region out of inTransistion
> ------------------------------------------------
>
>                 Key: HBASE-1745
>                 URL: https://issues.apache.org/jira/browse/HBASE-1745
>             Project: Hadoop HBase
>          Issue Type: Bug
>            Reporter: stack
>
> It seems fairly easy getting a region stuck "inTransitions" (See recent filings of mine).  Also, with addition to ClusterStatus of intransitions content, you can see this state now when you do analysis.  I want to roll RC2.  0.20.0 still has issues and we even know now what the worst of them are but the fixes can wait till 0.20.1.  Meantime, I need a means of bumping stuff that is stuck from the intransistions....  for 0.20.0 release in case we trip over this scenario for then we can effect a repair at least.  Otherwise, requires restart of cluster.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HBASE-1745) [tools] Tool to kick region out of inTransistion

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack resolved HBASE-1745.
--------------------------

       Resolution: Fixed
    Fix Version/s: 0.20.0

Applied 0.20.0 branch and trunk

> [tools] Tool to kick region out of inTransistion
> ------------------------------------------------
>
>                 Key: HBASE-1745
>                 URL: https://issues.apache.org/jira/browse/HBASE-1745
>             Project: Hadoop HBase
>          Issue Type: Bug
>            Reporter: stack
>             Fix For: 0.20.0
>
>
> It seems fairly easy getting a region stuck "inTransitions" (See recent filings of mine).  Also, with addition to ClusterStatus of intransitions content, you can see this state now when you do analysis.  I want to roll RC2.  0.20.0 still has issues and we even know now what the worst of them are but the fixes can wait till 0.20.1.  Meantime, I need a means of bumping stuff that is stuck from the intransistions....  for 0.20.0 release in case we trip over this scenario for then we can effect a repair at least.  Otherwise, requires restart of cluster.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-1745) [tools] Tool to kick region out of inTransistion

Posted by "ryan rawson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739142#action_12739142 ] 

ryan rawson commented on HBASE-1745:
------------------------------------

another option is to kill and restart the master, and let the cluster inspection take over.

> [tools] Tool to kick region out of inTransistion
> ------------------------------------------------
>
>                 Key: HBASE-1745
>                 URL: https://issues.apache.org/jira/browse/HBASE-1745
>             Project: Hadoop HBase
>          Issue Type: Bug
>            Reporter: stack
>
> It seems fairly easy getting a region stuck "inTransitions" (See recent filings of mine).  Also, with addition to ClusterStatus of intransitions content, you can see this state now when you do analysis.  I want to roll RC2.  0.20.0 still has issues and we even know now what the worst of them are but the fixes can wait till 0.20.1.  Meantime, I need a means of bumping stuff that is stuck from the intransistions....  for 0.20.0 release in case we trip over this scenario for then we can effect a repair at least.  Otherwise, requires restart of cluster.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.