hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject svn commit: r1226165 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Date Sat, 31 Dec 2011 18:37:08 GMT
Author: ramkrishna
Date: Sat Dec 31 18:37:08 2011
New Revision: 1226165

URL: http://svn.apache.org/viewvc?rev=1226165&view=rev
Log:
HBASE-5094 The META can hold an entry for a region with a different server name from the one
actually in the AssignmentManager thus making the region inaccessible. (Ram)

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1226165&r1=1226164&r2=1226165&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Sat Dec 31 18:37:08 2011
@@ -468,6 +468,8 @@ Release 0.92.0 - Unreleased
    HBASE-5100  Rollback of split could cause closed region to be opened again (Chunhui)
    HBASE-4397  -ROOT-, .META. tables stay offline for too long in recovery phase after all
RSs
                are shutdown at the same time (Ming Ma)
+   HBASE-5094  The META can hold an entry for a region with a different server name from
the one  
+               actually in the AssignmentManager thus making the region inaccessible. (Ram)
 
   TESTS
    HBASE-4450  test for number of blocks read: to serve as baseline for expected

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1226165&r1=1226164&r2=1226165&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java Sat
Dec 31 18:37:08 2011
@@ -79,6 +79,7 @@ import org.apache.hadoop.hbase.UnknownSc
 import org.apache.hadoop.hbase.YouAreDeadException;
 import org.apache.hadoop.hbase.catalog.CatalogTracker;
 import org.apache.hadoop.hbase.catalog.MetaEditor;
+import org.apache.hadoop.hbase.catalog.MetaReader;
 import org.apache.hadoop.hbase.catalog.RootLocationEditor;
 import org.apache.hadoop.hbase.client.Action;
 import org.apache.hadoop.hbase.client.Append;
@@ -2636,9 +2637,19 @@ public class HRegionServer implements HR
     checkIfRegionInTransition(region, OPEN);
     HRegion onlineRegion = this.getFromOnlineRegions(region.getEncodedName());
     if (null != onlineRegion) {
-      LOG.warn("Attempted open of " + region.getEncodedName()
-          + " but already online on this server");
-      return RegionOpeningState.ALREADY_OPENED;
+      // See HBASE-5094. Cross check with META if still this RS is owning the
+      // region.
+      Pair<HRegionInfo, ServerName> p = MetaReader.getRegion(
+          this.catalogTracker, region.getRegionName());
+      if (this.getServerName().equals(p.getSecond())) {
+        LOG.warn("Attempted open of " + region.getEncodedName()
+            + " but already online on this server");
+        return RegionOpeningState.ALREADY_OPENED;
+      } else {
+        LOG.warn("The region " + region.getEncodedName()
+            + " is online on this server but META does not have this server.");
+        this.removeFromOnlineRegions(region.getEncodedName());
+      }
     }
     LOG.info("Received request to open region: " +
       region.getRegionNameAsString());



Mime
View raw message