Go to file
Zhongyi Xie 3886dddc3b force flushing stats CF to avoid holding old logs (#5509)
Summary:
WAL records RocksDB writes to all column families. When user flushes a a column family, the old WAL will not accept new writes but cannot be deleted yet because it may still contain live data for other column families. (See https://github.com/facebook/rocksdb/wiki/Write-Ahead-Log#life-cycle-of-a-wal for detailed explanation)
Because of this, if there is a column family that receive very infrequent writes and no manual flush is called for it, it could prevent a lot of WALs from being deleted. PR https://github.com/facebook/rocksdb/pull/5046 introduced persistent stats column family which is a good example of such column families. Depending on the config, it may have long intervals between writes, and user is unaware of it which makes it difficult to call manual flush for it.
This PR addresses the problem for persistent stats column family by forcing a flush for persistent stats column family when 1) another column family is flushed 2) persistent stats column family's log number is the smallest among all column families, this way persistent stats column family will  keep advancing its log number when necessary, allowing RocksDB to delete old WAL files.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5509

Differential Revision: D16045896

Pulled By: miasantreble

fbshipit-source-id: 286837b633e988417f0096ff38384742d3b40ef4
2019-07-01 11:56:43 -07:00
buckifier Add support for loading dynamic libraries into the RocksDB environment (#5281) 2019-06-03 23:02:56 -07:00
build_tools build on ARM64 (#5450) 2019-06-18 11:27:45 -07:00
cache LRU Cache to enable mid-point insertion by default (#5508) 2019-06-27 10:20:57 -07:00
cmake
coverage
db force flushing stats CF to avoid holding old logs (#5509) 2019-07-01 11:56:43 -07:00
docs Text lint all .gitignore files 2019-05-15 11:37:27 -07:00
env Fix AlignedBuffer's usage in Encryption Env (#5396) 2019-06-19 16:46:20 -07:00
examples simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
file simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
hdfs
include/rocksdb LRU Cache to enable mid-point insertion by default (#5508) 2019-06-27 10:20:57 -07:00
java Add an option to put first key of each sst block in the index (#5289) 2019-06-24 20:54:04 -07:00
logging simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
memory Move some logging related files to logging/ (#5387) 2019-05-31 17:23:59 -07:00
memtable simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
monitoring force flushing stats CF to avoid holding old logs (#5509) 2019-07-01 11:56:43 -07:00
options LRU Cache to enable mid-point insertion by default (#5508) 2019-06-27 10:20:57 -07:00
port fix compilation error on MSVC (#5458) 2019-06-14 11:28:13 -07:00
table MultiGet parallel IO (#5464) 2019-06-30 20:56:04 -07:00
test_util Add an option to put first key of each sst block in the index (#5289) 2019-06-24 20:54:04 -07:00
third-party/gtest-1.7.0/fused-src/gtest
tools Add secondary instance to stress test (#5479) 2019-07-01 11:49:50 -07:00
trace_replay Block cache tracer: StartTrace return busy if trace is already started. (#5519) 2019-06-30 20:03:01 -07:00
util MultiGet parallel IO (#5464) 2019-06-30 20:56:04 -07:00
utilities Fix segfalut in ~DBWithTTLImpl() when called after Close() (#5485) 2019-06-20 13:08:17 -07:00
.clang-format
.gitignore Add support for loading dynamic libraries into the RocksDB environment (#5281) 2019-06-03 23:02:56 -07:00
.lgtm.yml
.travis.yml Switch Travis to Xenial build (#4789) 2019-06-17 10:20:02 -07:00
AUTHORS
CMakeLists.txt Persistent Stats: persist stats history to disk (#5046) 2019-06-17 15:21:50 -07:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md
COPYING
DEFAULT_OPTIONS_HISTORY.md
DUMP_FORMAT.md
HISTORY.md MultiGet parallel IO (#5464) 2019-06-30 20:56:04 -07:00
INSTALL.md
LANGUAGE-BINDINGS.md
LICENSE.Apache
LICENSE.leveldb
Makefile Update the version of ZStd for the Rocks Java static build 2019-06-18 11:57:01 -07:00
README.md
ROCKSDB_LITE.md
TARGETS Persistent Stats: persist stats history to disk (#5046) 2019-06-17 15:21:50 -07:00
USERS.md Add Alluxio to USERS.md (#5434) 2019-06-13 12:25:26 -07:00
Vagrantfile
WINDOWS_PORT.md
appveyor.yml Also build compression libraries on AppVeyor CI (#5226) 2019-06-24 10:41:07 -07:00
defs.bzl
issue_template.md
src.mk Support computing miss ratio curves using sim_cache. (#5449) 2019-06-17 16:41:12 -07:00
thirdparty.inc Fix build jemalloc api (#5470) 2019-06-24 17:40:32 -07:00

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 specially 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.