[
https://issues.apache.org/jira/browse/ZOOKEEPER-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14090699#comment-14090699
]
Rakesh R commented on ZOOKEEPER-2005:
-------------------------------------
OK. To find the exact reason why it is not working you could debug this. Also,
could you try to rename them from OS level.
QuorumPeer#writeLongToFile() and QuorumPeer#readLongFromFile() are the calls
which access the 'currentEpoch' file through BufferedWriter & BufferedReader.
I could see one case, its not closing the out stream when there is an exception
during writeLongToFile.
{code}
QuorumPeer#writeLongToFile()
} finally {
if (!aborted) {
// if the close operation (rename) fails we'll get notified.
// worst case the tmp file may still exist
out.close();
}
}
{code}
> 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)