Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
BOOKKEEPER-552: 64 Bits Ledger ID Generation #112
LongHierarchicalLedgerManager is being moved to HierarchicalLedgerManager and HierarchicalLedgerManager is being moved to LegacyHierarchicalLedgerManager.
LongHierarchicalLedgerManager (now HierarchicalLedgerManager) has been made backwards-compatible so that existing Bookkeeper instances running HierarchicalLedgerManager can be upgraded to the new code, which will allow 64-bit IDs.
This is achieved by having the HierarchicalLedgerManager proxy requests to the LegacyHierarchicalLedgerManager for ids which are less than Integer.MAX_VALUE
We also add a new id generator. The existing ZkLedgerIdGenerator is limited to 31 bits (about 2 million) ledgers because ZooKeeper's sequential id generator uses a signed int internally. IDs start going negative if you overflow it, which messes some stuff up.
The new ID generator uses a multi-level directory scheme to overcome this.
So my plan is this: Keep LongHierarchicalLedgerManager as is currently in master, move HierarchicalLedgerManager to LegacyHierarchicalLedgerManager and create the new backwards-compatible one as HierarchicalLedgerManager. This way, if you're already using LongHierarchicalLedgerManager, it will still work. If you're using the current HierarchicalLedgerManager, that will work, and if you (for some unknown reason) want to use the old legacy one, it still exists as well.
This PR supersedes #112 Instead of moving LongHierarchicalLedgerManager to HierarchicalLedgerManager, LongHierarchicalLedgerManager is still a stand-alone manager. HierarchicalLedgerManager has been moved to LegacyHierarchicalLedgerManager, and a new HierarchicalLedgerManager class has been put in its place, which is backwards-compatible with the original (now legacy) HierarchicalLedgerManager. This new HierarchicalLedgerManager leverages the new LongZkLedgerIdGenerator to generate Ids, and uses the LongHierarchicalLedgerManager to manage metadata for ledger IDs > 31 bits long. For shorter ledger ids, the LegacyHierarchicalLedgerManager is used, to keep backwards-compatibility. Author: Kyle Nusbaum <email@example.com> Reviewers: Enrico Olivelli <firstname.lastname@example.org>, Matteo Merli <email@example.com>, Venkateswararao Jujjuri (JV) <None> Closes #114 from knusbaum/BOOKKEEPER-552
…le reading the proposal packet ZOOKEEPER-2355:Ephemeral node is never deleted if follower fails while reading the proposal packet Author: arshadmohammad <firstname.lastname@example.org> Author: Mohammad Arshad <email@example.com> Reviewers: Michael Han <firstname.lastname@example.org>, Rakesh Radhakrishnan <email@example.com>, Flavio Junqueira <firstname.lastname@example.org>, Jiang Jiafu <email@example.com> Closes apache#112 from arshadmohammad/ZOOKEEPER-2355