[
https://issues.apache.org/jira/browse/HBASE-5209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13205936#comment-13205936
]
stack commented on HBASE-5209:
------------------------------
bq. 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.
If you do a getMaster, I'd think that you should get the active master, only,
in HConnection. Are you saying that it'll give you an Interface on the
non-active Master? Thats broke I'd say. For the name of the Master, yeah,
getServerName should be part of HMasterInterface.
On the patch:
{code}
+ private boolean isMasterRunning, isActiveMaster;
{code}
The above are the names of methods, not data members. Should be masterRunning
and activeMaster.
Whats going on here:
{code}
+ this.master = master;
+ this.isMasterRunning = isMasterRunning;
+ this.isActiveMaster = isActiveMaster;
{code}
So, we could be reporting a master that is not running and not the active
master? Why would we even care about it in that case?
getMasterInfo as method name returning master ServerName seems off. Is this
the 'active' master or non-running master?
I think we need to be clear that ClusterStatus reports on the active master
only (unless you want to add list of all running master which I don't think yet
possible since they do not register until they assume mastership --- hmmm...
looking further down in your patch, it looks like you are adding this facility
to zk).
Is this of any use?
+ public boolean isMasterRunning() {
I mean, if master is not running, can you even get a ClusterStatus from the
cluster?
Ditto for + public boolean isActiveMaster() {
Won't this just be true anytime you get a ClusterStatue?
You up the ClusterStatue version number but you don't act on it (what if you
are asked deserialize an earlier version of ClusterStatus?)
On MasterInterface, I'd suggest don't bother upping the version number -- just
add the new method on the end. Thats usually ok. Also, isActiveMaster of any
use even? (You could ask zk directly? Have hbaseadmin go ask zk rather than
go via the master at all? Isn't the master znode name its ServerName? Isn't
that what you need?)
I like your registering backup masters... and adding the list to the zk report.
> 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