You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Ivan Kelly (JIRA)" <ji...@apache.org> on 2012/10/08 11:22:02 UTC

[jira] [Commented] (BOOKKEEPER-421) ledger ids are long, but they are stored in zk as 10 characters max, which fundamentally limits them at 9 billion

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

Ivan Kelly commented on BOOKKEEPER-421:
---------------------------------------

A related problem which will need to be fixed first is that ledger ids are generated using a sequential znode. This limits the max ledger id to MAX_INT (2^31).
{code}
int parentCVersion = parentRecord.stat.getCversion();
CreateMode createMode = CreateMode.fromFlag(createRequest.getFlags());
if (createMode.isSequential()) {
    path = path + String.format(Locale.ENGLISH, "%010d", parentCVersion);
}
{code}

Again, the fix is simple, but backward compatibility could be a problem.
                
> ledger ids are long, but they are stored in zk as 10 characters max, which fundamentally limits them at 9 billion
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-421
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-421
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Ivan Kelly
>            Priority: Critical
>             Fix For: 4.2.0
>
>
> {code}
>     public static String getZKStringId(long id) {
>         return String.format("%010d", id);
>     }
> {code}
> Simple to fix, but we need it be backward compatible, which also shouldn't be a problem.

--
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