Skip to content

Commit

Permalink
sst_dump to reduce number of file reads (#6836)
Browse files Browse the repository at this point in the history
Summary:
sst_dump can issue many file reads from the file system. This doesn't work well with file systems without a OS cache, especially remote file systems. In order to mitigate this problem, several improvements are done:
1. --readahead_size is added, so that users can specify readahead size when scanning the data.
2. Force a 512KB tail readahead, which prevents three I/Os for footer, meta index and property blocks and hopefully index and filter blocks too.
3. Consoldiate SSTDump's I/Os before opening the file for read. Use the same file prefetch buffer.
Pull Request resolved: facebook/rocksdb#6836

Test Plan: Add a test that covers this new feature.

Reviewed By: pdillinger

Differential Revision: D21516607

fbshipit-source-id: 3ae43526286f67b2f4a5bdedfbc92719d579b87e
Signed-off-by: Changlong Chen <levisonchen@live.cn>
  • Loading branch information
siying authored and mm304321141 committed Jun 23, 2021
1 parent 549cae5 commit 65ac45c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions file/random_access_file_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Status RandomAccessFileReader::Read(const IOOptions& opts, uint64_t offset,
AlignedBuf* aligned_buf,
bool for_compaction) const {
(void)aligned_buf;

TEST_SYNC_POINT_CALLBACK("RandomAccessFileReader::Read", nullptr);
Status s;
uint64_t elapsed = 0;
{
Expand Down

0 comments on commit 65ac45c

Please sign in to comment.