You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Bruno Freudensprung (JIRA)" <ji...@apache.org> on 2014/02/01 15:12:09 UTC

[jira] [Commented] (ZOOKEEPER-1835) dynamic configuration file renaming fails on Windows

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

Bruno Freudensprung commented on ZOOKEEPER-1835:
------------------------------------------------

Hi,

I've tested the patch against the latest sources of the trunk and it is still ok: dynamic reconfiguration is working on Windows.
By the way: I've run the unit tests on the unpatched trunk on Ubuntu 12.04 64-bit and there was still one ClosedByInterruptException (see above) in TEST-org.apache.zookeeper.test.ObserverHierarchicalQuorumTest.txt. 
With the patch this exception does not occur.
I would 100% understand if you decided that letting me modify the existing AtomicFileOutputStream class is not a good idea. If this is the case, please tell me and I'll submit a patch that does not touch this class.
Regards

> dynamic configuration file renaming fails on Windows
> ----------------------------------------------------
>
>                 Key: ZOOKEEPER-1835
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1835
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: quorum
>    Affects Versions: 3.5.0
>         Environment: Windows 7 64-bit, Oracle Java  1.6.0_32-b05
>            Reporter: Bruno Freudensprung
>            Assignee: Bruno Freudensprung
>             Fix For: 3.5.0
>
>         Attachments: ZOOKEEPER-1835.patch, ZOOKEEPER-1835.patch, ZOOKEEPER-1835.patch, ZOOKEEPER-1835.patch
>
>
> On Windows, reconfig fails to rename the tmp dynamic config file to the real dynamic config filename.
> Javadoc of java.io.File.renameTo says the behavior is highly plateform dependent, so I guess this should not be a big surprise.
> The problem occurs in src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java that could be modified like this:
> + curFile.delete();
> if (!tmpFile.renameTo(curFile)) {
> + configFile.delete();
> if (!tmpFile.renameTo(configFile)) {
> As suggested by Alex in https://issues.apache.org/jira/browse/ZOOKEEPER-1691 (btw there is more information about my test scenario over there) it is a bit "scary" to delete the current configuration file.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)