[
https://issues.apache.org/jira/browse/HBASE-5209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207747#comment-13207747
]
[email protected] commented on HBASE-5209:
------------------------------------------------------
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3892/
-----------------------------------------------------------
Review request for hbase.
Summary
-------
Problem:
There is no method in the HBase client-facing APIs to determine which of the
masters is currently active. This can be especially useful in setups with
multiple backup masters.
Solution:
Augment ClusterStatus to return the currently active master and the list of
backup masters.
Notes:
* I uncovered a race condition in ActiveMasterManager, between when it
determines that it did not win the original race to be the active master, and
when it reads the ServerName of the active master. If the active master goes
down in that time, the read to determine the active master's ServerName will
fail ungracefully and the candidate master will abort. The solution
incorporated in this patch is to check to see if the read of the ServerName
succeeded before trying to use it.
* I fixed some minor formatting issues while going through the code. I can
take these changes out if it is considered improper to commit such non-related
changes with the main changes.
This addresses bug HBASE-5209.
https://issues.apache.org/jira/browse/HBASE-5209
Diffs
-----
src/main/java/org/apache/hadoop/hbase/ClusterStatus.java b849429
src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java 2f60b23
src/main/java/org/apache/hadoop/hbase/master/HMaster.java 9d21903
src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java f6f3f71
src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java 111f76e
src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java 3e3d131
src/test/java/org/apache/hadoop/hbase/master/TestActiveMasterManager.java
16e4744
src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java bc98fb0
Diff: https://reviews.apache.org/r/3892/diff
Testing
-------
* Ran mvn -P localTests test multiple times - no new tests fail
* Ran mvn -P localTests -Dtest=TestActiveMasterManager test multiple runs - no
failures
* Ran mvn -P localTests -Dtest=TestMasterFailover test multiple runs - no
failures
* Started active and multiple backup masters, then killed active master, then
brought it back up (will now be a backup master)
* Did the following before and after killing
* hbase fsck - checked output to see that active and backup masters are
reported properly
* zk_dump - checked that active and backup masters are reported properly
* Started cluster with no backup masters to make sure change operates correctly
that way
* Ran dev-support/test-patch.sh - no new issues fail:
-1 overall.
+1 @author. The patch does not contain any @author tags.
+1 tests included. The patch appears to include 7 new or modified tests.
-1 javadoc. The javadoc tool appears to have generated -136 warning
messages.
+1 javac. The applied patch does not increase the total number of javac
compiler warnings.
+1 findbugs. The patch does not introduce any new Findbugs (version )
warnings.
+1 release audit. The applied patch does not increase the total number of
release audit warnings.
Thanks,
David
> HConnection/HMasterInterface should allow for way to get hostname of
> currently active master in multi-master HBase setup
> ------------------------------------------------------------------------------------------------------------------------
>
> Key: HBASE-5209
> URL: https://issues.apache.org/jira/browse/HBASE-5209
> Project: HBase
> Issue Type: Improvement
> Components: master
> Affects Versions: 0.94.0, 0.90.5, 0.92.0
> Reporter: Aditya Acharya
> Assignee: David S. Wang
> Fix For: 0.94.0, 0.90.7, 0.92.1
>
> Attachments: HBASE-5209-v0.diff, HBASE-5209-v1.diff
>
>
> I have a multi-master HBase set up, and I'm trying to programmatically
> determine which of the masters is currently active. But the API does not
> allow me to do this. There is a getMaster() method in the HConnection class,
> but it returns an HMasterInterface, whose methods do not allow me to find out
> which master won the last race. The API should have a
> getActiveMasterHostname() or something to that effect.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira