rocksdb/db/db_impl
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
..
db_impl_compaction_flush.cc force flushing stats CF to avoid holding old logs (#5509) 2019-07-01 11:56:43 -07:00
db_impl_debug.cc Persistent Stats: persist stats history to disk (#5046) 2019-06-17 15:21:50 -07:00
db_impl_experimental.cc simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
db_impl_files.cc simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
db_impl_open.cc Fix ingested file and direcotry not being sync (#5435) 2019-06-21 10:15:38 -07:00
db_impl_readonly.cc Make format 2019-05-31 15:24:43 -07:00
db_impl_readonly.h Organizing rocksdb/db directory 2019-05-31 11:57:01 -07:00
db_impl_secondary.cc Override check consistency for DBImplSecondary (#5469) 2019-06-17 15:39:55 -07:00
db_impl_secondary.h Override check consistency for DBImplSecondary (#5469) 2019-06-17 15:39:55 -07:00
db_impl_write.cc force flushing stats CF to avoid holding old logs (#5509) 2019-07-01 11:56:43 -07:00
db_impl.cc Fix ingested file and direcotry not being sync (#5435) 2019-06-21 10:15:38 -07:00
db_impl.h force flushing stats CF to avoid holding old logs (#5509) 2019-07-01 11:56:43 -07:00
db_secondary_test.cc Fix a bug caused by secondary not skipping the beginning of new MANIFEST (#5472) 2019-06-18 11:21:37 -07:00