HBASE-964 Startup stuck "waiting for root region"
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@711149 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f806f7fdea
commit
97fbf7da76
|
@ -60,7 +60,8 @@ Release 0.19.0 - Unreleased
|
||||||
HBASE-976 HADOOP 0.19.0 RC0 is broke; replace with HEAD of branch-0.19
|
HBASE-976 HADOOP 0.19.0 RC0 is broke; replace with HEAD of branch-0.19
|
||||||
HBASE-977 Arcane HStoreKey comparator bug
|
HBASE-977 Arcane HStoreKey comparator bug
|
||||||
HBASE-979 REST web app is not started automatically
|
HBASE-979 REST web app is not started automatically
|
||||||
|
HBASE-964 Startup stuck "waiting for root region"
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
HBASE-901 Add a limit to key length, check key and value length on client side
|
HBASE-901 Add a limit to key length, check key and value length on client side
|
||||||
HBASE-890 Alter table operation and also related changes in REST interface
|
HBASE-890 Alter table operation and also related changes in REST interface
|
||||||
|
|
|
@ -123,7 +123,6 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable {
|
||||||
protected final HBaseConfiguration conf;
|
protected final HBaseConfiguration conf;
|
||||||
|
|
||||||
private final ServerConnection connection;
|
private final ServerConnection connection;
|
||||||
private final AtomicBoolean haveRootRegion = new AtomicBoolean(false);
|
|
||||||
private FileSystem fs;
|
private FileSystem fs;
|
||||||
private Path rootDir;
|
private Path rootDir;
|
||||||
private final Random rand = new Random();
|
private final Random rand = new Random();
|
||||||
|
@ -304,8 +303,20 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable {
|
||||||
boolean quiesceRequested = false;
|
boolean quiesceRequested = false;
|
||||||
// A sleeper that sleeps for msgInterval.
|
// A sleeper that sleeps for msgInterval.
|
||||||
Sleeper sleeper = new Sleeper(this.msgInterval, this.stopRequested);
|
Sleeper sleeper = new Sleeper(this.msgInterval, this.stopRequested);
|
||||||
|
boolean haveRootRegion = false;
|
||||||
try {
|
try {
|
||||||
init(reportForDuty(sleeper));
|
init(reportForDuty(sleeper));
|
||||||
|
// Try to get the root region location from the master.
|
||||||
|
if (!haveRootRegion) {
|
||||||
|
HServerAddress rootServer = hbaseMaster.getRootRegionLocation();
|
||||||
|
if (rootServer != null) {
|
||||||
|
// By setting the root region location, we bypass the wait imposed on
|
||||||
|
// HTable for all regions being assigned.
|
||||||
|
this.connection.setRootRegionLocation(
|
||||||
|
new HRegionLocation(HRegionInfo.ROOT_REGIONINFO, rootServer));
|
||||||
|
haveRootRegion = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
long lastMsg = 0;
|
long lastMsg = 0;
|
||||||
// Now ask master what it wants us to do and tell it what we have done
|
// Now ask master what it wants us to do and tell it what we have done
|
||||||
for (int tries = 0; !stopRequested.get() && isHealthy();) {
|
for (int tries = 0; !stopRequested.get() && isHealthy();) {
|
||||||
|
@ -693,17 +704,6 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable {
|
||||||
* the end of the main HRegionServer run loop.
|
* the end of the main HRegionServer run loop.
|
||||||
*/
|
*/
|
||||||
private void housekeeping() {
|
private void housekeeping() {
|
||||||
// Try to get the root region location from the master.
|
|
||||||
if (!haveRootRegion.get()) {
|
|
||||||
HServerAddress rootServer = hbaseMaster.getRootRegionLocation();
|
|
||||||
if (rootServer != null) {
|
|
||||||
// By setting the root region location, we bypass the wait imposed on
|
|
||||||
// HTable for all regions being assigned.
|
|
||||||
this.connection.setRootRegionLocation(
|
|
||||||
new HRegionLocation(HRegionInfo.ROOT_REGIONINFO, rootServer));
|
|
||||||
haveRootRegion.set(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// If the todo list has > 0 messages, iterate looking for open region
|
// If the todo list has > 0 messages, iterate looking for open region
|
||||||
// messages. Send the master a message that we're working on its
|
// messages. Send the master a message that we're working on its
|
||||||
// processing so it doesn't assign the region elsewhere.
|
// processing so it doesn't assign the region elsewhere.
|
||||||
|
|
Loading…
Reference in New Issue