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

Sijie Guo commented on BOOKKEEPER-713:
--------------------------------------

no. the cookie is used to ensure that for the life of bookie, its configuration 
stays the same. if any of the bookie directories becomes unavailable (e.g the 
disk isn't mounted correctly), the bookie should become unavailable. that's the 
reason why we should write zookeeper only after writing to all local 
directories. 

> Bookie should store the cookie in zookeeper first
> -------------------------------------------------
>
>                 Key: BOOKKEEPER-713
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-713
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-server
>    Affects Versions: 4.2.2
>            Reporter: Vinay
>            Assignee: Vinay
>         Attachments: BOOKKEEPER-713.patch
>
>
> following code in {{Bookie#checkEnvironment(..)}} should store the cookie in 
> zookeeper and then to local disks for {{newEnv}}
> {code}            if (newEnv) {
>                 if (missedCookieDirs.size() > 0) {
>                     LOG.debug("Directories missing cookie file are {}", 
> missedCookieDirs);
>                     masterCookie.writeToDirectory(journalDirectory);
>                     for (File dir : allLedgerDirs) {
>                         masterCookie.writeToDirectory(dir);
>                     }
>                 }
>                 masterCookie.writeToZooKeeper(zk, conf);
>             }{code}
> Otherwise if the {{masterCookie.writeToZooKeeper(zk, conf);}} fails due to 
> some exception, then bookie cannot start again.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to