[
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.