hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject svn commit: r1456310 - in /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase: master/AssignmentManager.java regionserver/handler/OpenRegionHandler.java
Date Thu, 14 Mar 2013 03:08:26 GMT
Author: ramkrishna
Date: Thu Mar 14 03:08:25 2013
New Revision: 1456310

URL: http://svn.apache.org/r1456310
Log:
HBASE-8040 - Race condition in AM after HBASE-7521 (only 0.94) (Ram)


Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1456310&r1=1456309&r2=1456310&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Thu Mar 14 03:08:25 2013
@@ -1693,10 +1693,16 @@ public class AssignmentManager extends Z
       try {
         LOG.debug("Assigning region " + state.getRegion().getRegionNameAsString() +
           " to " + plan.getDestination().toString());
+        long currentOfflineTimeStamp = state.getStamp();
         RegionOpeningState regionOpenState = serverManager.sendRegionOpen(plan.getDestination(),
             state.getRegion(), versionOfOfflineNode);
         if (regionOpenState == RegionOpeningState.OPENED) {
           // Transition RegionState to PENDING_OPEN
+          // Check if already the offline state has been updated due to a
+          // failure in prev assign
+          if (state.isOffline() && currentOfflineTimeStamp != state.getStamp()) {
+            return;
+          }
           if (state.isOffline() && !state.isOpening()) {
             state.update(RegionState.State.PENDING_OPEN,
                 System.currentTimeMillis(), plan.getDestination());

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java?rev=1456310&r1=1456309&r2=1456310&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
Thu Mar 14 03:08:25 2013
@@ -100,6 +100,7 @@ public class OpenRegionHandler extends E
       region = openRegion();
       if (region == null) {
         tryTransitionToFailedOpen(regionInfo);
+        transitionToFailedOpen = true;
         return;
       }
       boolean failed = true;



Mime
View raw message