Skip to content
A library that provides an embeddable, persistent key-value store for fast storage.
C++ Java Python Perl C Shell Other
Branch: master
Clone or download
riversand963 and facebook-github-bot Fix a data race between GetColumnFamilyMetaData and MarkFilesBeingCom…
…pacted (#6056)

Summary:
Use db mutex to protect the execution of Version::GetColumnFamilyMetaData()
called in DBImpl::GetColumnFamilyMetaData().
Without mutex, GetColumnFamilyMetaData() races with MarkFilesBeingCompacted()
for access to FileMetaData::being_compacted.
Other than mutex, there are several more alternatives.

- Make FileMetaData::being_compacted an atomic variable. This will make
  FileMetaData non-copy-able.

- Separate being_compacted from FileMetaData. This requires re-organizing data
  structures that are already used in many places.

Test Plan (dev server):
```
make check
```
Pull Request resolved: #6056

Differential Revision: D18620488

Pulled By: riversand963

fbshipit-source-id: 87f89660b5d5e2ab4ef7962b7b2a7d00e346aa3b
Latest commit 0ce0edb Nov 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
buckifier Abandon use of folly::Optional (#6036) Nov 14, 2019
build_tools New Bloom filter implementation for full and partitioned filters (#6007) Nov 14, 2019
cache Misc hashing updates / upgrades (#5909) Oct 25, 2019
cmake cmake: s/SNAPPY_LIBRARIES/snappy_LIBRARIES/ (#5687) Aug 16, 2019
coverage Fix interpreter lines for files with python2-only syntax. Jul 9, 2019
db Fix a data race between GetColumnFamilyMetaData and MarkFilesBeingCom… Nov 21, 2019
docs Blog post for write_unprepared (#5711) Aug 15, 2019
env Add Env::SanitizeEnvOptions (#5885) Oct 14, 2019
examples Add asserts in transaction example (#6055) Nov 20, 2019
file Apply formatter to recent 200+ commits. (#5830) Sep 20, 2019
hdfs Add copyright headers per FB open-source checkup tool. (#5199) Apr 18, 2019
include/rocksdb More fixes to auto-GarbageCollect in BackupEngine (#6023) Nov 14, 2019
java fix typo (#6025) Nov 13, 2019
logging Apply formatter to recent 200+ commits. (#5830) Sep 20, 2019
memory Charge block cache for cache internal usage (#5797) Sep 16, 2019
memtable Misc hashing updates / upgrades (#5909) Oct 25, 2019
monitoring Apply formatter to recent 200+ commits. (#5830) Sep 20, 2019
options Apply formatter to recent 200+ commits. (#5830) Sep 20, 2019
port Fix block cache ID uniqueness for Windows builds (#5844) Oct 12, 2019
table Remove a few unnecessary includes Nov 19, 2019
test_util New Bloom filter implementation for full and partitioned filters (#6007) Nov 14, 2019
third-party Refactor/consolidate legacy Bloom implementation details (#5784) Sep 16, 2019
tools db_stress sometimes generates keys close to SST file boundaries (#6037) Nov 19, 2019
trace_replay Misc hashing updates / upgrades (#5909) Oct 25, 2019
util Add operator[] to autovector::iterator_impl. (#6047) Nov 20, 2019
utilities Mark blob files not needed by any memtables/SSTs obsolete (#6032) Nov 19, 2019
.clang-format A script that automatically reformat affected lines Jan 14, 2014
.gitignore Make buckifier python3 compatible (#5922) Oct 23, 2019
.lgtm.yml Create lgtm.yml for LGTM.com C/C++ analysis (#4058) Jun 26, 2018
.travis.yml Partial rebalance of TEST_GROUPs for Travis (#6010) Nov 7, 2019
.watchmanconfig Added .watchmanconfig file to rocksdb repo (#5593) Jul 19, 2019
AUTHORS Update RocksDB Authors File Oct 18, 2017
CMakeLists.txt Abandon use of folly::Optional (#6036) Nov 14, 2019
CODE_OF_CONDUCT.md Adopt Contributor Covenant Aug 30, 2019
CONTRIBUTING.md Add Code of Conduct Dec 6, 2017
COPYING Add GPLv2 as an alternative license. Apr 28, 2017
DEFAULT_OPTIONS_HISTORY.md options.delayed_write_rate use the rate of rate_limiter by default. May 24, 2017
DUMP_FORMAT.md First version of rocksdb_dump and rocksdb_undump. Jun 19, 2015
HISTORY.md Fix a data race between GetColumnFamilyMetaData and MarkFilesBeingCom… Nov 21, 2019
INSTALL.md Update the version of the dependencies used by the RocksJava static b… Dec 19, 2018
LANGUAGE-BINDINGS.md LANGUAGE-BINDINGS.md: mention python-rocksdb Mar 20, 2019
LICENSE.Apache Change RocksDB License Jul 15, 2017
LICENSE.leveldb Add back the LevelDB license file Jul 17, 2017
Makefile Abandon use of folly::Optional (#6036) Nov 14, 2019
README.md Replaced some words (#5877) Oct 7, 2019
ROCKSDB_LITE.md Fix some typos in comments and docs. Mar 8, 2018
TARGETS Abandon use of folly::Optional (#6036) Nov 14, 2019
USERS.md Add avrio to USERS.md (#5748) Sep 16, 2019
Vagrantfile Adding CentOS 7 Vagrantfile & build script Feb 26, 2018
WINDOWS_PORT.md #5145 , rename port/dirent.h to port/port_dirent.h to avoid compile e… Apr 4, 2019
appveyor.yml New API to get all merge operands for a Key (#5604) Aug 6, 2019
defs.bzl Add clarifying/instructive header to TARGETS and defs.bzl Nov 6, 2019
issue_template.md Add a template for issues Sep 29, 2017
src.mk FilterPolicy consolidation, part 2/2 (#5966) Oct 24, 2019
thirdparty.inc Fix build jemalloc api (#5470) Jun 25, 2019

README.md

RocksDB: A Persistent Key-Value Store for Flash and RAM Storage

Linux/Mac Build Status Windows Build status PPC64le Build Status

RocksDB is developed and maintained by Facebook Database Engineering Team. It is built on earlier work on LevelDB by Sanjay Ghemawat (sanjay@google.com) and Jeff Dean (jeff@google.com)

This code is a library that forms the core building block for a fast key-value server, especially suited for storing data on flash drives. It has a Log-Structured-Merge-Database (LSM) design with flexible tradeoffs between Write-Amplification-Factor (WAF), Read-Amplification-Factor (RAF) and Space-Amplification-Factor (SAF). It has multi-threaded compactions, making it especially suitable for storing multiple terabytes of data in a single database.

Start with example usage here: https://github.com/facebook/rocksdb/tree/master/examples

See the github wiki for more explanation.

The public interface is in include/. Callers should not include or rely on the details of any other header files in this package. Those internal APIs may be changed without warning.

Design discussions are conducted in https://www.facebook.com/groups/rocksdb.dev/

License

RocksDB is dual-licensed under both the GPLv2 (found in the COPYING file in the root directory) and Apache 2.0 License (found in the LICENSE.Apache file in the root directory). You may select, at your option, one of the above-listed licenses.

You can’t perform that action at this time.