[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14097636#comment-14097636
 ] 

Hongchao Deng commented on ZOOKEEPER-2006:
------------------------------------------

[~shralex]
Good for sharing the thoughts.

Currently the standalone logic isn't separated out. I think this could be a 
good chance to refactor standalone code. For example, look at the code:
{code}
    public boolean isDistributed() {
        return quorumVerifier!=null && (!standaloneEnabled || 
quorumVerifier.getVotingMembers().size() > 1);
    }
{code}
This could be changed to simply returning the boolean.

h2. Regarding standalone mode and dynamic config.

Let me summarize my thoughts and more is welcome to add:

* Pre-assumption: "standaloneEnabled" and "dynamicConfigFile" is *mutually 
exclusive* in config file.
* Backward-compatibility: A single line -- "server.X=..." in *static* config 
file is still standalone mode.

h3. TODO
1. check mutual exclusiveness of "standaloneEnabled" and "dynamicConfigFile".
2. Make sure standalone wouldn't create dynamic file.
3. Enforce the minimum number of servers is 2 for any dynamic ensemble. So a 
server with dynamic file of *one* server wouldn't be able to start.

One question,
what if a user use the new format
{code}
server.1=localhost:X:X:participant; port
{code}
This is a problem because standalone wouldn't get client port from quorum 
verifier (there isn't one).

> Standalone mode won't take client port from dynamic config file
> ---------------------------------------------------------------
>
>                 Key: ZOOKEEPER-2006
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2006
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.5.0
>            Reporter: Hongchao Deng
>
> Currently, when a server only specify client port only in dynamic file, on 
> standalone mode it will be ignored and no client port will be setup.
> It confuses the use of dynamic file and we should come up with something to 
> handle this. One solution would be dynamic file doesn't allow standalone mode.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to