HBASE-3545 Possible liveness issue with MasterServerAddress in HRegionServer getMaster

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1071725 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2011-02-17 17:46:58 +00:00
parent 6e5f3c7024
commit e9bfa72555
2 changed files with 20 additions and 7 deletions

View File

@ -102,6 +102,10 @@ Release 0.90.2 - Unreleased
HBASE-3520 Update our bundled hadoop from branch-0.20-append to latest
(rpc version 43)
BUG FIXES
HBASE-3545 Possible liveness issue with MasterServerAddress in
HRegionServer getMaster (Greg Bowyer via Stack)
Release 0.90.1 - Unreleased
NEW FEATURES

View File

@ -1433,15 +1433,12 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
*/
private HServerAddress getMaster() {
HServerAddress masterAddress = null;
while ((masterAddress = masterAddressManager.getMasterAddress()) == null) {
if (stopped) {
return null;
}
LOG.debug("No master found, will retry");
sleeper.sleep();
}
HMasterRegionInterface master = null;
while (!stopped && master == null) {
masterAddress = getMasterAddress();
LOG.info("Attempting connect to Master server at " + masterAddress);
try {
// Do initial RPC setup. The final argument indicates that the RPC
// should retry indefinitely.
@ -1465,6 +1462,18 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
return masterAddress;
}
private HServerAddress getMasterAddress() {
HServerAddress masterAddress = null;
while ((masterAddress = masterAddressManager.getMasterAddress()) == null) {
if (stopped) {
return null;
}
LOG.debug("No master found, will retry");
sleeper.sleep();
}
return masterAddress;
}
/**
* @return True if successfully invoked {@link #reportForDuty()}
* @throws IOException