bookkeeper icon indicating copy to clipboard operation
bookkeeper copied to clipboard

add async or sync for :ledger metadata index's rocksdb write

Open StevenLuMT opened this issue 3 years ago • 1 comments

Descriptions of the changes in this PR:

Motivation

bookie flush mainly composed of three pieces: 1. flush-entrylog: it's flushing entrylog 2. flush-locations-index: it's flushing entrly location index, use sync mode to flush 3. flush-ledger-index: it's flushing ledger metadata index, this index(LedgerMetadataIndex) use async mode to flush

sync is different from async:

  • sync mode:
    1. create a batch; 5. add msg to the batch 6. call method(batch.flush) to flush the batch

  • async mode:
    1. just call method(sync) to write the data 2. the rocksdb server will be timed to flush the data

Changes

  1. add async or sync for : ledger metadata index rocksdb write
  2. add switch to open this feature, default not open, use default async

StevenLuMT avatar Jun 26 '22 15:06 StevenLuMT

reopen the pr, run the new workflow

StevenLuMT avatar Aug 20 '22 04:08 StevenLuMT