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

Hongchao Deng commented on ZOOKEEPER-1992:
------------------------------------------

[~shralex]
editStaticConfig sounds better. I will change it.
{quote}
if you look at the log for the failed test, there is a null pointer exception. 
It happens because the test doesn't create a static config file - it creates a 
QuorumPeer object directly and has only a dynamic config file. To fix this 
change
QuorumPeer.needEraseClient last line to "return (configFilename!=null && ... "
{quote}
The flow is:
{code}
needEraseClient => writeDynamicConfig => editStaticConfig
{code}
editStaticConfig is the only thing using configFile. Is it better to prevent 
that in
{code}
    private static void editStaticConfig(final String configFileStr,
                                        ......
        // some tests may not have static config file
        if (configFileStr == null)
            return;

        File configFile = (new VerifyingFileFactory.Builder(LOG)
                .warnForRelativePath()
                .failForNonExistingPath()
                .build()).create(configFileStr);
{code}

> backward compatibility of zoo.cfg
> ---------------------------------
>
>                 Key: ZOOKEEPER-1992
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1992
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.5.0
>            Reporter: Hongchao Deng
>            Assignee: Hongchao Deng
>            Priority: Blocker
>             Fix For: 3.5.0
>
>         Attachments: ZOOKEEPER-1992-gitaddp.patch, 
> ZOOKEEPER-1992-without-spaces.patch, ZOOKEEPER-1992-withspaces.patch, 
> draft-2.patch, draft-3.patch, draft-4.patch, draft.patch
>
>
> This issue supersedes our discussion in ZOOKEEPER-1989.
> To summarize, ZK users can seamlessly upgrade 3.4 to 3.5. But two things will 
> happen:
> 1. the server list will be separated out as a dynamic file (the original 
> should be backup automatically).
> 2. Client port is mandatory on reconfig. So when reconfig the server itself 
> (its id), the client port in config file will be removed and replaced by the 
> one in reconfig (written in dynamic file).



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

Reply via email to