HBASE-3832 Failing TestMasterFailover.testMasterFailoverWithMockedRITOnDeadRS up on jenkins; added debug and cleared out extra regionOnline of -ROOT-

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1098023 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2011-04-29 23:25:18 +00:00
parent 47fe311acd
commit c80200bded
4 changed files with 10 additions and 18 deletions

View File

@ -141,8 +141,8 @@ class WritableRpcEngine implements RpcEngine {
protocol, ticket, rpcTimeout);
if (logDebug) {
// FIGURE HOW TO TURN THIS OFF!
// long callTime = System.currentTimeMillis() - startTime;
// LOG.debug("Call: " + method.getName() + " " + callTime);
long callTime = System.currentTimeMillis() - startTime;
LOG.debug("Call: " + method.getName() + " " + callTime);
}
return value.get();
}

View File

@ -226,13 +226,6 @@ public class AssignmentManager extends ZooKeeperListener {
// TODO: Regions that have a null location and are not in regionsInTransitions
// need to be handled.
// Add -ROOT- and .META. on regions map. They must be deployed if we got
// this far.
ServerName sn = this.catalogTracker.getMetaLocation();
regionOnline(HRegionInfo.FIRST_META_REGIONINFO, sn);
sn = this.catalogTracker.getRootLocation();
regionOnline(HRegionInfo.ROOT_REGIONINFO, sn);
// Scan META to build list of existing regions, servers, and assignment
// Returns servers who have not checked in (assumed dead) and their regions
Map<ServerName,List<Pair<HRegionInfo,Result>>> deadServers =
@ -243,28 +236,29 @@ public class AssignmentManager extends ZooKeeperListener {
processRegionsInTransition();
}
public void processRegionsInTransition()
void processRegionsInTransition()
throws KeeperException, IOException, InterruptedException {
List<String> nodes = ZKUtil.listChildrenAndWatchForNewChildren(watcher,
watcher.assignmentZNode);
// Run through all regions. If they are not assigned and not in RIT, then
// its a clean cluster startup, else its a failover.
boolean userRegionsOutOnCluster = false;
boolean regionsToProcess = false;
for (Map.Entry<HRegionInfo, ServerName> e: this.regions.entrySet()) {
if (!e.getKey().isMetaRegion() && e.getValue() != null) {
LOG.debug("Found " + e + " out on cluster");
userRegionsOutOnCluster = true;
regionsToProcess = true;
break;
}
if (nodes.contains(e.getKey().getEncodedName())) {
LOG.debug("Found " + e + " in RITs");
userRegionsOutOnCluster = true;
// Could be a meta region.
regionsToProcess = true;
break;
}
}
// If we found user regions out on cluster, its a failover.
if (userRegionsOutOnCluster) {
if (regionsToProcess) {
LOG.info("Found regions out on cluster or in RIT; failover");
if (!nodes.isEmpty()) {
for (String encodedRegionName: nodes) {

View File

@ -198,8 +198,8 @@ public class SplitLogWorker extends ZooKeeperListener implements Runnable {
try {
taskReadyLock.wait();
} catch (InterruptedException e) {
LOG.warn("SplitLogWorker interurrpted while waiting for task," +
" exiting", e);
LOG.info("SplitLogWorker interrupted while waiting for task," +
" exiting: " + e.toString());
assert exitWorker == true;
return;
}

View File

@ -31,10 +31,8 @@ import java.util.concurrent.atomic.AtomicLong;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HServerInfo;
import org.apache.hadoop.hbase.master.SplitLogManager;
import org.apache.hadoop.hbase.regionserver.SplitLogWorker;
import org.apache.hadoop.hbase.util.Bytes;