You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Patrick Hunt (Commented) (JIRA)" <ji...@apache.org> on 2012/02/29 19:01:58 UTC

[jira] [Commented] (ZOOKEEPER-1161) Provide an option for disabling auto-creation of the data directroy

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

Patrick Hunt commented on ZOOKEEPER-1161:
-----------------------------------------

I've seen this with a couple users now. They bork the datadir/logdir setup and end up "losing" the datastore, as a result start with a new empty datadir/namespace. Many zk clients just think this means they are starting fresh and recreate from scratch (e.g. re-shard), then the user is in serious trouble because they have effectively created split brain.

I think having this as off by default would have to be the way to go. Too many embeded/existing users rely the status quo. To be clear, what I mean is:

1) by default zk server continues to autocreate the data/log dirs as necessary.
2) only if an environment option is set would we do this check and exit() if the directory doesn't already exist.

Additionally we would need an "initialize" option in zkServer.sh that creates the directory if it doesn't exist already to make it easier for users. Having a force option (to force re-initialization) seems also useful.

All this is similar to how hadoop namenode does it if I'm not mistaken.

                
> Provide an option for disabling auto-creation of the data directroy
> -------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1161
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1161
>             Project: ZooKeeper
>          Issue Type: New Feature
>          Components: scripts, server
>            Reporter: Roman Shaposhnik
>             Fix For: 3.5.0
>
>
> Currently if ZK starts and doesn't see and existing dataDir it tries to create it. There should be an option to tweak this behavior. As for default, my personal opinion is to NOW allow autocreate.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira