• A
    Disable readahead when using mmap for reads · 4bf169f0
    Andrew Kryczka 提交于
    Summary:
    `ReadaheadRandomAccessFile` had an unwritten assumption, which was that its wrapped file's `Read()` function always copies into the provided scratch buffer. Actually this was not true when the wrapped file was `PosixMmapReadableFile`, whose `Read()` implementation does no copying and instead returns a `Slice` pointing directly into the  `mmap`'d memory region. This PR:
    
    - prevents `ReadaheadRandomAccessFile` from ever wrapping mmap readable files
    - adds an assert for the assumption `ReadaheadRandomAccessFile` makes about the wrapped file's use of scratch buffer
    Closes https://github.com/facebook/rocksdb/pull/3813
    
    Differential Revision: D7891513
    
    Pulled By: ajkr
    
    fbshipit-source-id: dc64a55222d6af280c39a1852ee39e9e9d7cde7d
    4bf169f0
table_cache.cc 17.3 KB