HADOOP-2430 Master will not shut down if there are no active region servers
git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk/src/contrib/hbase@604309 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
10bac1971d
commit
9b68f4bf41
|
@ -81,6 +81,7 @@ Trunk (unreleased changes)
|
|||
HADOOP-2418 Fix assertion failures in TestTableMapReduce, TestTableIndex,
|
||||
and TestTableJoinMapReduce
|
||||
HADOOP-2414 Fix ArrayIndexOutOfBoundsException in bloom filters.
|
||||
HADOOP-2430 Master will not shut down if there are no active region servers
|
||||
|
||||
IMPROVEMENTS
|
||||
HADOOP-2401 Add convenience put method that takes writable
|
||||
|
|
|
@ -1029,6 +1029,10 @@ public class HMaster extends Thread implements HConstants, HMasterInterface,
|
|||
*/
|
||||
try {
|
||||
for (RegionServerOperation op = null; !closed.get(); ) {
|
||||
if (shutdownRequested && serversToServerInfo.size() == 0) {
|
||||
startShutdown();
|
||||
break;
|
||||
}
|
||||
if (rootRegionLocation.get() != null) {
|
||||
// We can't process server shutdowns unless the root region is online
|
||||
|
||||
|
@ -1175,6 +1179,22 @@ public class HMaster extends Thread implements HConstants, HMasterInterface,
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Start shutting down the master
|
||||
*/
|
||||
private void startShutdown() {
|
||||
closed.set(true);
|
||||
stopScanners();
|
||||
synchronized(toDoQueue) {
|
||||
toDoQueue.clear(); // Empty the queue
|
||||
delayedToDoQueue.clear(); // Empty shut down queue
|
||||
toDoQueue.notifyAll(); // Wake main thread
|
||||
}
|
||||
synchronized (serversToServerInfo) {
|
||||
serversToServerInfo.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Stop the root and meta scanners so that the region servers serving meta
|
||||
* regions can shut down.
|
||||
|
@ -1356,16 +1376,7 @@ public class HMaster extends Thread implements HConstants, HMasterInterface,
|
|||
// If the only servers we know about are meta servers, then we can
|
||||
// proceed with shutdown
|
||||
LOG.info("All user tables quiesced. Proceeding with shutdown");
|
||||
closed.set(true);
|
||||
stopScanners();
|
||||
synchronized(toDoQueue) {
|
||||
toDoQueue.clear(); // Empty the queue
|
||||
delayedToDoQueue.clear(); // Empty shut down queue
|
||||
toDoQueue.notifyAll(); // Wake main thread
|
||||
}
|
||||
synchronized (serversToServerInfo) {
|
||||
serversToServerInfo.notifyAll();
|
||||
}
|
||||
startShutdown();
|
||||
}
|
||||
|
||||
if (shutdownRequested && !closed.get()) {
|
||||
|
|
Loading…
Reference in New Issue