tikv / raft-engine

A persistent storage engine for Multi-Raft log
Apache License 2.0
565 stars 88 forks source link

Speed up read performance with AIO #248

Open tabokie opened 2 years ago

tabokie commented 2 years ago
  1. Expanding FileSystem interface to provide async tasking capability:
    
    trait AsyncContext {
    fn wait() -> Result<()>;
    }

trait FileSystem { pub type AsyncIoContext: AsyncContext; fn new_async_context() -> AsyncContext; fn read(ctx: &mut AsyncIoContext, offset: u64, size: usize) -> IoResult; }



2. Modify `read_entry` implementation to generate read requests of all file blocks, then wait for completion.

For best kernel compatibility, use AIO to implement the first version. Reference: https://docs.rs/nix/latest/nix/sys/aio/fn.aio_suspend.html