[
https://issues.apache.org/jira/browse/ZOOKEEPER-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13888714#comment-13888714
]
Alexander Shraer commented on ZOOKEEPER-1835:
---------------------------------------------
Thanks Bruno!
Should we use this new class for writing out epoch numbers instead of having a
separate QuorumPeer.writeLongToFile ?
[~phunt] can you please take a look ? (I see that you originally wrote that
function for ZOOKEEPER-1427)
also re Bruno's question about modifying the existing AtomicFileOutputStream.
> There is a small bug in the current implementation of the
> configBackwardCompatibilityMode though: even if the clientPort= line is
> mentioned the the zoo.cfg file, the port is not appended at the end of the
> line of the dynamic config. Don't know if it "deserves" a
> bug though.
I'm not sure we want to do this automatically - the user still needs to specify
the server specs according to the new format
for this and the other servers, in all of the config files. Appending just the
client port for one of the server in each config file is not enough unless we
fix the rest automatically too, which we don't do.
> 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)