HBASE-4478 Improve AssignmentManager.handleRegion so that it can process certain ZK state

in the case of RS offline


git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1201186 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2011-11-12 04:40:41 +00:00
parent 3e37baa9f3
commit 62b5c04786
2 changed files with 10 additions and 1 deletions

View File

@ -424,6 +424,8 @@ Release 0.92.0 - Unreleased
HBASE-4511 There is data loss when master failovers
HBASE-4577 Region server reports storefileSizeMB bigger than
storefileUncompressedSizeMB (gaojinchao)
HBASE-4478 Improve AssignmentManager.handleRegion so that it can process certain ZK state
in the case of RS offline
TESTS
HBASE-4450 test for number of blocks read: to serve as baseline for expected

View File

@ -24,6 +24,7 @@ import java.io.DataOutput;
import java.io.IOException;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@ -61,6 +62,7 @@ import org.apache.hadoop.hbase.executor.EventHandler.EventType;
import org.apache.hadoop.hbase.executor.ExecutorService;
import org.apache.hadoop.hbase.executor.RegionTransitionData;
import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException;
import org.apache.hadoop.hbase.master.AssignmentManager.RegionState;
import org.apache.hadoop.hbase.master.handler.ClosedRegionHandler;
import org.apache.hadoop.hbase.master.handler.DisableTableHandler;
import org.apache.hadoop.hbase.master.handler.EnableTableHandler;
@ -162,6 +164,10 @@ public class AssignmentManager extends ZooKeeperListener {
//Thread pool executor service for timeout monitor
private java.util.concurrent.ExecutorService threadPoolExecutorService;
private List<EventType> ignoreStatesRSOffline = Arrays.asList(new EventType[]{
EventType.RS_ZK_REGION_FAILED_OPEN, EventType.RS_ZK_REGION_CLOSED });
/**
* Constructs a new assignment manager.
@ -613,7 +619,8 @@ public class AssignmentManager extends ZooKeeperListener {
String prettyPrintedRegionName = HRegionInfo.prettyPrint(encodedName);
// Verify this is a known server
if (!serverManager.isServerOnline(sn) &&
!this.master.getServerName().equals(sn)) {
!this.master.getServerName().equals(sn)
&& !ignoreStatesRSOffline.contains(data.getEventType())) {
LOG.warn("Attempted to handle region transition for server but " +
"server is not online: " + prettyPrintedRegionName);
return;