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

Ivan Kelly commented on BOOKKEEPER-773:
---------------------------------------

Further to Sijie's comment about znodeVersion, Cookie should not have a znode 
version at all. znodeVersion is only used in the case of read-modify-write. 
This occurs in two places, FileSystemUpgrade.java:L317 and 
BookieShell.java:L1064. In both cases, the znodeVersion is only relevant in the 
scope of a single method.

I suggest you remove znodeVersion completely from Cookie itself. Then modify 
readFromKeeper to return a Versioned<Cookie> and modify deleteFromZooKeeper and 
writeToZookeeper to take a Version. For the initial write, use Version.NEW. 
There's already an implementation of Version for zk in o.a.b.m.ZkVersion. You 
can reuse this.

Finally, you don't seem to be doing any validation on curUseHostNameAsBookieID. 
You just read it and rewrite it.

> Provide admin tool to rename bookie identifier in Cookies
> ---------------------------------------------------------
>
>                 Key: BOOKKEEPER-773
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-773
>             Project: Bookkeeper
>          Issue Type: Sub-task
>          Components: bookkeeper-server
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>             Fix For: 4.3.0
>
>         Attachments: 001-BOOKKEEPER-773-rename-bookieid-in-cookies.patch, 
> 002-BOOKKEEPER-773-rename-bookieid-in-cookies.patch, 
> 003-BOOKKEEPER-773-rename-bookieid-in-cookies.patch, 
> 004-BOOKKEEPER-773-rename-bookieid.patch, 
> 005-BOOKKEEPER-773-rename-bookieid.patch, 
> 006-BOOKKEEPER-773-rename-bookieid.patch, 
> 007-BOOKKEEPER-773-rename-bookieid.patch, 
> 008-BOOKKEEPER-773-rename-bookieid.patch, 
> 009-BOOKKEEPER-773-rename-bookieid.patch, 
> 010-BOOKKEEPER-773-rename-bookieid.patch
>
>
> The idea of this JIRA to implement a mechanism to efficiently rename the 
> bookie identifier present in the Cookies. Cookie information will be present 
> in:
> - ledger & journal directories in each Bookie server
> - cookies znode in ZooKeeper



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

Reply via email to