forked from cockroachdb/pebble
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
objstorage,sstable: add read-before for reader creation and iter inde…
…x/filter blocks We consider two use cases for read-before when using a objstorageprovider.remoteReadable, given the high latency (and cost) of each read operation: - When a sstable.Reader is opened, it needs to read the footer, metaindex block and meta properties block. It starts by reading the footer which is at the end of the table and then proceeds to read the other two. Instead of doing 3 tiny reads, we would like to do one read. - When a single-level or two-level iterator is opened, it reads the (top-level) index block first. When the iterator is used, it will typically follow this by reading the filter block (since SeeKPrefixGE is common in CockroachDB). For a two-level iterator it will also read the lower-level index blocks which are after the filter block and before the top-level index block. It would be ideal if reading the top-level index block read enough to include the filter block. And for two-level iterators this would also include the lower-level index blocks. In both use-cases we want the first read from the remoteReadable to do a larger read, and read bytes earlier than the requested read, hence "read-before". Subsequent reads from the remoteReadable can use the usual readahead logic (for the second use-case above, this can help with sequential reads of the lower-level index blocks when the read-before was insufficient to satisfy such reads). Since remoteReadHandle already has a buffer for read-ahead, we utilize it for this read-before buffering pattern too. While here, we bump up the read-ahead size for compactions to 8MB, given the lower concurrency (and thereby higher tolerance to memory usage). Informs cockroachdb#2328
- Loading branch information
1 parent
2a2e3e1
commit 1bc0866
Showing
17 changed files
with
284 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.