[
https://issues.apache.org/jira/browse/BOOKKEEPER-300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439436#comment-13439436
]
Vinay commented on BOOKKEEPER-300:
----------------------------------
You mean to say, if instanceid present in zookeeper, then we need to do strict
checking of version. I agree with this.
Problem may come in case of upgrade cookie version 3 to cookie version 4.
Say current cluster is running with cookie version 3. In this case instanceid
will not be present in zookeeper.
Now, without doing format, if the cluster is upgraded to bookie which are
having cookie version 4, in this case should allow cookie version 3. Right..?
Please check whether below conditions work for above cases
{code} if (c.layoutVersion < 3 && c.layoutVersion != layoutVersion) {
String errMsg = "Cookie is of too old version " + c.layoutVersion;
LOG.error(errMsg);
throw new BookieException.InvalidCookieException(errMsg);
} else if (!(c.layoutVersion >= 3 && c.bookieHost.equals(bookieHost)
&& c.journalDir.equals(journalDir)
&& c.ledgerDirs.equals(ledgerDirs)
// check instance id only for layoutVersion 4 onwards
&& ((c.layoutVersion == 3 && instanceId == null) || (instanceId != null
&& instanceId
.equals(c.instanceId))))) {
String errMsg = "Cookie [" + this + "] is not matching with [" + c
+ "]";
throw new BookieException.InvalidCookieException(errMsg);
}{code}
> Create Bookie format command
> ----------------------------
>
> Key: BOOKKEEPER-300
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-300
> Project: Bookkeeper
> Issue Type: New Feature
> Components: bookkeeper-server
> Affects Versions: 4.1.0
> Reporter: Rakesh R
> Attachments: BOOKKEEPER-300.patch, BOOKKEEPER-300.patch
>
>
> Provide a bookie format command. Then the admin would just have to run the
> command on each machine, which will prepare the bookie env
> +Zookeeper paths (znodes):+
> - ledger's root path
> - bookie's available path
> +Directories:+
> - Journal directories
> - Ledger directories
--
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