Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • there are 3 major concerns for this problem
    • how to store metadata for 64-bits-id ledgers in zookeeper?
    • how to generate 64-bits ledger id using zookeeper?
    • how to achieve backward compatibility?
  • how to store?
    • Salesforce built a Long Hierarchical Ledger Manager
    • Ledger ID is split in 3-4-4-4-4 components.
    • No backward compatible on initial built
    • backward compatibility?
      • for ledger id whose higher 32 bits are zero, use split 2-4-4
      • for ledger id whose higher 32 bits are higher than zero, use split 3-4-4-4-4
      • since the first component has different characters (2 vs 3), it is easy to achieve backward compatibility
    • negative ledger id discussion
  • how to generate?

    • use zookeeper sequence znode to create lower 32 bits

    • use another znode to create sequential buckets, the buckets are used for higher 32 bits.
    • when to create bucket?
      • when lower 32-bits generation is approaching 31 bits, create a new bucket.
      • creating a new bucket and the id generation will happen under one zookeeper 'multi' transaction call to guarantee there is only one bucket is created.

Action