Uploaded image for project: 'Bookkeeper'
  1. Bookkeeper

Improve performance of entry log range read per ledger entries



    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.3.0
    • Component/s: bookkeeper-server
    • Labels:
    • Environment:



      We observed random I/O reads when some subscribers fall behind (on some topics), as delivery needs to scan the entry logs (thru ledger index), which are interleaved with ledger entries across all ledgers being served.

      Essentially, the ledger index is a non-clustered index. It is not effective when a large number of ledger entries need to be served, which tend to be scattered around due to interleaving.

      Some possible improvements:
      1. Change the ledger entries buffer to use a SkipList (or other suitable), sorted on (ledger, entry sequence). When the buffer is flushed, the entry log is written out in the already-sorted order.

      The "active" ledger index can point to the entries buffer (SkipList), and fixed up with entry-log position once latter is persisted.

      Or, the ledger index can be just rebuilt on demand. The entry log file tail can have index attached (light-weight b-tree, similar with big-table). We need to track per ledger which log files contribute entries to it, so that in-memory index can be rebuilt from the tails of corresponding log files.

      2. Use affinity concept to make ensembles of ledgers (belonging to same topic) as identical as possible. This will help above 1. be more effective.


        1. 0001-BOOKKEEPER-432-First-pass.patch
          49 kB
          Ivan Kelly
        2. BookieLedgerStorageProposal.pdf
          35 kB
          Yixue (Andrew) Zhu
        3. BOOKKEEPER-432.diff
          54 kB
          Sijie Guo
        4. PortSkipListLedgerStore.patch
          79 kB
          Yixue (Andrew) Zhu



            • Assignee:
              yx3zhu@gmail.com Yixue (Andrew) Zhu
              yx3zhu@gmail.com Yixue (Andrew) Zhu
            • Votes:
              0 Vote for this issue
              6 Start watching this issue


              • Created: