You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2011/02/17 18:46:58 UTC
svn commit: r1071725 - in /hbase/trunk: CHANGES.txt
src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Author: stack
Date: Thu Feb 17 17:46:58 2011
New Revision: 1071725
URL: http://svn.apache.org/viewvc?rev=1071725&view=rev
Log:
HBASE-3545 Possible liveness issue with MasterServerAddress in HRegionServer getMaster
Modified:
hbase/trunk/CHANGES.txt
hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1071725&r1=1071724&r2=1071725&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Feb 17 17:46:58 2011
@@ -101,6 +101,10 @@ Release 0.90.2 - Unreleased
TASK
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
Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1071725&r1=1071724&r2=1071725&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java Thu Feb 17 17:46:58 2011
@@ -1433,15 +1433,12 @@ public class HRegionServer implements HR
*/
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 HR
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