[
https://issues.apache.org/jira/browse/ZOOKEEPER-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13889078#comment-13889078
]
Bruno Freudensprung commented on ZOOKEEPER-1835:
------------------------------------------------
Hi Alexander,
{quote}Should we use this new class for writing out epoch numbers instead of
having a separate QuorumPeer.writeLongToFile ? {quote}
This is almost the same code (writeLongToFile is actually where I got the
"idiom"), except this modification in the AtomicFileOutputStream. However I
preferred leaving it as-is for the sake of "not touching something that is
working for aesthetics reasons". But if you or Patrick Hunt feel ok about it, I
can certainly do it. I am just puzzled by this difference between fc.force()
and fd.sync().
Concerning the backward compatibitity mode behavior, I entirely trust you since
I don't know much about ZK (to say the least).
> 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)