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

Jacky007 commented on ZOOKEEPER-1674:
-------------------------------------

[~fpj] I have noticed the discussions in 
[ZOOKEEPER-1642|https://issues.apache.org/jira/browse/ZOOKEEPER-1642].
This issue is related to  what [~thawan] talks about in  
[ZOOKEEPER-1642|https://issues.apache.org/jira/browse/ZOOKEEPER-1642].

It is no need to clear zkDb when shutdown in ZooKeeperServer.java. 
{quote}
    public void shutdown() {
        ...
        if (zkDb != null) {
            zkDb.clear();
        }
        ...
    }
{quote}

                
> There is no need to clear & load the database across leader election
> --------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1674
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1674
>             Project: ZooKeeper
>          Issue Type: Improvement
>            Reporter: Jacky007
>
> It is interesting to notice the piece of codes in QuorumPeer.java
>  /* ZKDatabase is a top level member of quorumpeer 
>      * which will be used in all the zookeeperservers
>      * instantiated later. Also, it is created once on 
>      * bootup and only thrown away in case of a truncate
>      * message from the leader
>      */
>     private ZKDatabase zkDb;
> It is introduced by ZOOKEEPER-596. Now, we just drop the database every 
> leader election.
> We can keep it safely with ZOOKEEPER-1549.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to