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)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1226165 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ramkrishna 2011-12-31 18:37:08 +00:00
parent 453de3a66c
commit ebc3945450
2 changed files with 16 additions and 3 deletions

View File

@ -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

View File

@ -79,6 +79,7 @@ import org.apache.hadoop.hbase.UnknownScannerException;
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 HRegionInterface, HBaseRPCErrorHandler,
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());