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

Rakesh R commented on ZOOKEEPER-2005:
-------------------------------------

[~iocanel] This is new logic added in 3.4.6 version. Are you running in Windows 
env ?

Can you check which is causing the failure - deletion of the currentEpoch or 
renaming of currentEpoch.tmp
{code}
AtomicFileOutputStream.java
    if (!origFile.delete() || !tmpFile.renameTo(origFile)) {
        throw new IOException(
                "Could not rename temporary file " + tmpFile
                        + " to " + origFile);
    }
{code}

Also, could you see any other external process is accessing the currentEpoch.

> Failure to setCurrentEpoch on lead
> ----------------------------------
>
>                 Key: ZOOKEEPER-2005
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2005
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: leaderElection
>    Affects Versions: 3.4.6
>            Reporter: Ioannis Canellos
>
> We are embedding the zookeeper server in our container and every now and then 
> I see the exception below when running our integration tests suite.
> This is something that have never bother us before when using 3.4.5 but we do 
> see in 3.4.6. 
> When this occurs, the ensemble is not formed.
> java.io.IOException: Could not rename temporary file 
> /data/zookeeper/0001/version-2/currentEpoch.tmp to 
> /data/zookeeper/0001/version-2/currentEpoch
>         at 
> org.apache.zookeeper.common.AtomicFileOutputStream.close(AtomicFileOutputStream.java:82)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeer.writeLongToFile(QuorumPeer.java:1202)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeer.setCurrentEpoch(QuorumPeer.java:1223)
>         at org.apache.zookeeper.server.quorum.Leader.lead(Leader.java:395)



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

Reply via email to