hbase-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1226169&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/branches/0.92/CHANGES.txt
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1226169&r1=1226168&r2=1226169&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Sat Dec 31 18:44:37 2011
@@ -504,6 +504,8 @@ Release 0.92.0 - Unreleased
    HBASE-5100  Rollback of split could cause closed region to be opened again (Chunhui)
    HBASE-5099  ZK event thread waiting for root region assignment may block server
                shutdown handler for the region sever the root region was on (Jimmy)
+   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-4492  TestRollingRestart fails intermittently

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1226169&r1=1226168&r2=1226169&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Sat Dec 31 18:44:37 2011
@@ -78,6 +78,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.Delete;
@@ -2422,9 +2423,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