You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Arshad Mohammad (JIRA)" <ji...@apache.org> on 2017/01/20 18:04:26 UTC

[jira] [Resolved] (ZOOKEEPER-2660) acceptedEpoch and currentEpoch data inconsistency, ZK process can not start!

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-2660?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arshad Mohammad resolved ZOOKEEPER-2660.
----------------------------------------
    Resolution: Duplicate

> acceptedEpoch and currentEpoch data inconsistency, ZK process can not start!
> ----------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-2660
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2660
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: quorum
>    Affects Versions: 3.4.6, 3.4.9
>         Environment: ZK: 3.4.9
>            Reporter: Yongcheng Liu
>
> 1. currentEpoch is bigger than acceptedEpoch, ZK will throw IOException when start loadDataBase.
> 2. function bug. In function setAcceptedEpoch and setCurrentEpoch, it is modify memory variable first, then write epoch to file. If write file failed, the memory has been modified.
> solution as follow:
> for example,
> 	public void setAcceptedEpoch(long e) throws IOException {
> 		acceptedEpoch = e;
> 		writeLongToFile(ACCEPTED_EPOCH_FILENAME, e);
> 	}
> need to modify as follow:
> 	public void setAcceptedEpoch(long e) throws IOException {
> 		writeLongToFile(ACCEPTED_EPOCH_FILENAME, e);
> 		acceptedEpoch = e;
> 	}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)