[
https://issues.apache.org/jira/browse/BOOKKEEPER-438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13630278#comment-13630278
]
Jiannan Wang commented on BOOKKEEPER-438:
-----------------------------------------
{quote}
One thing about this is that it's imposing another zookeeper access for the
simple case, i.e. flat ledger manager. This could be worked around by passing
the ledgermanager as a parameter to generateLedgerId and having that directly
call createLedgerMetadata (for flat this generateLedgerId could directly call
createLedgerMetadata and be a noop itself). I don't know if this is nice or
even worth it though. Just a consideration.
{quote}
Good point, your workaround might work. Actually I also considered this problem
when coding, but I think the flat ledger manager is an old and not recommended
ledger manager, so it's acceptable.
{quote}
This wont be able to go past 2^31 for ledger ids.
See
https://github.com/apache/zookeeper/blob/trunk/src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java#L369
it uses parentCVersion, which is defined a few lines up as an int. This could
perhaps be sidestepped with a check and set implementation, which updates a
number stored in the value of the znode. There's another open question here
though. what happens with the version of the znode wraps at the int boundary?
This version is also an int.
{quote}
Yes, but this JIRA only focus on moving ledger id generation out of ledger
manager not enlarge ledger id space, so it keeps previous ledger id generation
fashion.
{quote}
Actually, looking at the code, wrapping around may be ok. But it's best to find
out somehow.
{quote}
Could you figure out more details?
{quote}
+1 to sijie's comment on migration. I don't think we should rely on the admin
running a tool though. We could add something to the LedgerLayout to specify
which ledger id generator is in use. If none specified, either use the current
implementation or upgrade using the information available in zk.
{quote}
Yeah, this is exactly what I want to do. It will also involve the NUM_SLOTS
discussed in BOOKKEEPER-552.
> Move ledger id generation out of LedgerManager
> ----------------------------------------------
>
> Key: BOOKKEEPER-438
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-438
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-server, hedwig-server
> Reporter: Sijie Guo
> Assignee: Jiannan Wang
> Fix For: 4.3.0
>
> Attachments: BOOKKEEPER-438.patch, BOOKKEEPER-438.patch,
> BOOKKEEPER-438.patch, BOOKKEEPER-438.patch, BOOKKEEPER-438.patch,
> BOOKKEEPER-438.patch, BOOKKEEPER-438.patch, BOOKKEEPER-438.patch
>
>
> Move id generation out of LedgerManager to ensure different ledger manager
> implementation shared same ledger id space in ZooKeeper, which is necessary
> for migration between different ledger managers.
--
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