HBASE-2927 BaseScanner gets stale HRegionInfo in some race cases

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@986887 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2010-08-18 19:40:49 +00:00
parent 625a079b73
commit 0e481c64e8
2 changed files with 4 additions and 2 deletions

View File

@ -479,6 +479,7 @@ Release 0.21.0 - Unreleased
HBASE-2919 initTableReducerJob: Unused method parameter
(Libor Dener via Stack)
HBASE-2923 Deadlock between HRegion.internalFlushCache and close
HBASE-2927 BaseScanner gets stale HRegionInfo in some race cases
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -538,7 +538,7 @@ abstract class BaseScanner extends Chore {
* @throws IOException
*/
protected void checkAssigned(final HRegionInterface regionServer,
final MetaRegion meta, final HRegionInfo info,
final MetaRegion meta, HRegionInfo info,
final String hostnameAndPort, final long startCode, boolean checkTwice)
throws IOException {
boolean tryAgain = false;
@ -555,6 +555,7 @@ abstract class BaseScanner extends Chore {
if (r != null && !r.isEmpty()) {
sa = getServerAddress(r);
sc = getStartCode(r);
info = master.getHRegionInfo(r.getRow(), r);
}
}
if (sa != null && sa.length() > 0) {
@ -566,7 +567,7 @@ abstract class BaseScanner extends Chore {
* a dead server. Regions that were on a dead server will get reassigned
* by ProcessServerShutdown
*/
if (info.isOffline() ||
if (info == null || info.isOffline() ||
this.master.getRegionManager().regionIsInTransition(info.getRegionNameAsString()) ||
(serverName != null && this.master.getServerManager().isDead(serverName))) {
return;