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
nav.yml
- title: Docs
href: /docs/
category: docs
- title: GitHub
href: https://github.com/facebook/rocksdb/
category: external
- title: API (C++)
href: https://github.com/facebook/rocksdb/tree/master/include/rocksdb
category: external
- title: API (Java)
href: https://github.com/facebook/rocksdb/tree/master/java/src/main/java/org/rocksdb
category: external
- title: Support
href: /support.html
category: support
- title: Blog
href: /blog/
category: blog
- title: Facebook
href: https://www.facebook.com/groups/rocksdb.dev/
category: external
# Use external for external links not associated with the paths of the current site.
# If a category is external, site urls, for example, are not prepended to the href, etc..
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...