rocksdb/utilities/blob_db
Sagar Vemuri 4c9aa30a62 Auto enable Periodic Compactions if a Compaction Filter is used (#5865)
Summary:
- Periodic compactions are auto-enabled if a compaction filter or a compaction filter factory is set, in Level Compaction.
- The default value of `periodic_compaction_seconds` is changed to UINT64_MAX, which lets RocksDB auto-tune periodic compactions as needed. An explicit value of 0 will still work as before ie. to disable periodic compactions completely. For now, on seeing a compaction filter along with a UINT64_MAX value for `periodic_compaction_seconds`, RocksDB will make SST files older than 30 days to go through periodic copmactions.

Some RocksDB users make use of compaction filters to control when their data can be deleted, usually with a custom TTL logic. But it is occasionally possible that the compactions get delayed by considerable time due to factors like low writes to a key range, data reaching bottom level, etc before the TTL expiry. Periodic Compactions feature was originally built to help such cases. Now periodic compactions are auto enabled by default when compaction filters or compaction filter factories are used, as it is generally helpful to all cases to collect garbage.

`periodic_compaction_seconds` is set to a large value, 30 days, in `SanitizeOptions` when RocksDB sees that a `compaction_filter` or `compaction_filter_factory` is used.

This is done only for Level Compaction style.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5865

Test Plan:
- Added a new test `DBCompactionTest.LevelPeriodicCompactionWithCompactionFilters` to make sure that `periodic_compaction_seconds` is set if either `compaction_filter` or `compaction_filter_factory` options are set.
- `COMPILE_WITH_ASAN=1 make check`

Differential Revision: D17659180

Pulled By: sagar0

fbshipit-source-id: 4887b9cf2e53cf2dc93a7b658c6b15e1181217ee
2019-10-29 15:05:51 -07:00
..
blob_compaction_filter.cc Apply modernize-use-override (2nd iteration) 2019-02-14 14:41:36 -08:00
blob_compaction_filter.h Move blob_index.h to db/ (#5919) 2019-10-14 12:54:05 -07:00
blob_db_impl_filesnapshot.cc Move some logging related files to logging/ (#5387) 2019-05-31 17:23:59 -07:00
blob_db_impl.cc Auto enable Periodic Compactions if a Compaction Filter is used (#5865) 2019-10-29 15:05:51 -07:00
blob_db_impl.h BlobDB::Open() should put all existing trash files to delete scheduler (#5103) 2019-03-26 10:53:19 -07:00
blob_db_iterator.h Refactor ArenaWrappedDBIter into separate files (#5801) 2019-09-13 13:50:43 -07:00
blob_db_listener.h Blob DB: Improve FIFO eviction 2018-03-06 11:57:42 -08:00
blob_db_test.cc Move blob_index.h to db/ (#5919) 2019-10-14 12:54:05 -07:00
blob_db.cc simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
blob_db.h Introduce a new MultiGet batching implementation (#5011) 2019-04-11 14:28:26 -07:00
blob_dump_tool.cc Divide file_reader_writer.h and .cc (#5803) 2019-09-16 10:33:51 -07:00
blob_dump_tool.h Divide file_reader_writer.h and .cc (#5803) 2019-09-16 10:33:51 -07:00
blob_file.cc Apply formatter to recent 200+ commits. (#5830) 2019-09-20 12:04:26 -07:00
blob_file.h Divide file_reader_writer.h and .cc (#5803) 2019-09-16 10:33:51 -07:00
blob_log_format.cc utilities: Fix build failure with -Werror=maybe-uninitialized (#5074) 2019-03-18 11:35:06 -07:00
blob_log_format.h BlobDB: use char array instead of string as buffer (#4662) 2018-11-13 12:49:29 -08:00
blob_log_reader.cc Divide file_reader_writer.h and .cc (#5803) 2019-09-16 10:33:51 -07:00
blob_log_reader.h Divide file_reader_writer.h and .cc (#5803) 2019-09-16 10:33:51 -07:00
blob_log_writer.cc Divide file_reader_writer.h and .cc (#5803) 2019-09-16 10:33:51 -07:00
blob_log_writer.h Use delete to disable automatic generated methods. (#5009) 2019-09-11 18:09:00 -07:00