rocksdb
rocksdb copied to clipboard
PosixMmapReadableFile::Read and PosixRandomAccessFile::Read has different behavior
Expected behavior
The behavior of PosixMmapReadableFile::Read and PosixRandomAccessFile::Read should be same.
Actual behavior
When the param offset is beyound file size, PosixMmapReadableFile::Read returns IOError but PosixRandomAccessFile::Read returns OK.
Steps to reproduce the behavior
Create a PosixMmapReadableFile and a PosixRandomAccessFile, write same content, then read beyound file size.
The fix should be simple, the key is which behavior is expected. This issue was found in our branch while we add PosixMmapReadableFile to env_basic_test.cc.