Revision 2d9efc9ab2475876270741f0592da13eef44096b authored by Cheng Chang on 12 March 2020, 01:36:43 UTC, committed by Facebook GitHub Bot on 12 March 2020, 01:40:05 UTC
Summary:
In Linux, when reopening DB with many SST files, profiling shows that 100% system cpu time spent for a couple of seconds for `GetLogicalBufferSize`. This slows down MyRocks' recovery time when site is down.

This PR introduces two new APIs:
1. `Env::RegisterDbPaths` and `Env::UnregisterDbPaths` lets `DB` tell the env when it starts or stops using its database directories . The `PosixFileSystem` takes this opportunity to set up a cache from database directories to the corresponding logical block sizes.
2. `LogicalBlockSizeCache` is defined only for OS_LINUX to cache the logical block sizes.

Other modifications:
1. rename `logical buffer size` to `logical block size` to be consistent with Linux terms.
2. declare `GetLogicalBlockSize` in `PosixHelper` to expose it to `PosixFileSystem`.
3. change the functions `IOError` and `IOStatus` in `env/io_posix.h` to have external linkage since they are used in other translation units too.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6457

Test Plan:
1. A new unit test is added for `LogicalBlockSizeCache` in `env/io_posix_test.cc`.
2. A new integration test is added for `DB` operations related to the cache in `db/db_logical_block_size_cache_test.cc`.

`make check`

Differential Revision: D20131243

Pulled By: cheng-chang

fbshipit-source-id: 3077c50f8065c0bffb544d8f49fb10bba9408d04
1 parent 331e619
History
File Mode Size
_data
_docs
_includes
_layouts
_posts
_sass
_top-level
blog
css
doc-type-examples
docs
static
.gitignore -rw-r--r-- 56 bytes
CNAME -rw-r--r-- 11 bytes
CONTRIBUTING.md -rw-r--r-- 4.7 KB
Gemfile -rw-r--r-- 59 bytes
Gemfile.lock -rw-r--r-- 3.5 KB
LICENSE-DOCUMENTATION -rw-r--r-- 17.7 KB
README.md -rw-r--r-- 3.1 KB
TEMPLATE-INFORMATION.md -rw-r--r-- 2.5 KB
_config.yml -rw-r--r-- 2.8 KB
feed.xml -rw-r--r-- 1.2 KB
index.md -rw-r--r-- 174 bytes

README.md

back to top