[
https://issues.apache.org/jira/browse/HDFS-2681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13187149#comment-13187149
]
Bikas Saha commented on HDFS-2681:
----------------------------------
>>Can ActiveStandbyElector be made package-private?
Let me read up on all these package annotations and see what makes sense.
>>Also, it can't really guard against split brain
The guarantee is based on setting the correct timeouts. Another instance can
only become active after the session timeout. The session timeout is
recommended to be at least 3X the zookeeper disconnect timeout.
enterNeutralMode is called when zookeeper client disconnects from zookeeper
server or when zookeeper servers lose quorum. My understanding is that when
there is a network disconnection then zookeeper client will disconnect from the
server and post a disconnect event. So if your TCP disconnect timeouts are not
set insanely high (> session timeout) then enterSafeMode will be called before
session timeout expires and someone else becomes a master. Does this clarify?
>>should also be ALL_CAPS
It public because its a well defined property of the class.
Is the ALLCAPS on static strings a convention? You mean the member name should
be all caps or the value? I added the random UID to prevent accidental
operation on this file from some admin. It does not hurt and it safer than
using just a nicely named file. Anyways, I changed it.
>>Could use Arrays.copyOf()
I first used .clone() and then was pointed to System.ArrayCopy() and now
pointed to Array.copyOf(). Could you please point me to any place that lists
the pros and cons of different array copying methods (of which there seem to be
many)?
>>Rename operationSuccess etc to isSuccessCode
I think the current names read OK with the if() statements.
>>Make ActiveStandbyElectorTester an inner class of TestActiveStandbyElector.
I first wrote it that way. But there is a problem.
Tester_constructor()->super_constructor()->Tester().getNewZookeeper()->returns
mock.
So I need to have mock initialized before constructing the tester object. So I
made mock a static member. But then java complained that inner classes cannot
have static members.
>>Some of the INFO level logs are probably better off at DEBUG level.
Could you please point me to some place which explains what to log at different
log levels?
> Add ZK client for leader election
> ---------------------------------
>
> Key: HDFS-2681
> URL: https://issues.apache.org/jira/browse/HDFS-2681
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: ha
> Affects Versions: HA branch (HDFS-1623)
> Reporter: Suresh Srinivas
> Assignee: Bikas Saha
> Fix For: HA branch (HDFS-1623)
>
> Attachments: HDFS-2681.HDFS-1623.patch, HDFS-2681.HDFS-1623.patch,
> HDFS-2681.HDFS-1623.patch, HDFS-2681.HDFS-1623.patch, Zookeeper based Leader
> Election and Monitoring Library.pdf
>
>
> ZKClient needs to support the following capabilities:
> # Ability to create a znode for co-ordinating leader election.
> # Ability to monitor and receive call backs when active znode status changes.
> # Ability to get information about the active node.
--
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