bookkeeper
bookkeeper copied to clipboard
add async or sync for :ledger metadata index's rocksdb write
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
- add async or sync for : ledger metadata index rocksdb write
- add switch to open this feature, default not open, use default async
reopen the pr, run the new workflow