rocksdb/options
Jay Huh e230e4d248 Make OffpeakTimeInfo available in VersionSet (#12018)
Summary:
As mentioned in  https://github.com/facebook/rocksdb/issues/11893, we are going to use the offpeak time information to pre-process TTL-based compactions. To do so, we need to access `daily_offpeak_time_utc` in `VersionStorageInfo::ComputeCompactionScore()` where we pick the files to compact. This PR is to make the offpeak time information available at the time of compaction-scoring. We are not changing any compaction scoring logic just yet. Will follow up in a separate PR.

There were two ways to achieve what we want.
1.  Make `MutableDBOptions` available in `ColumnFamilyData` and `ComputeCompactionScore()` take `MutableDBOptions` along with `ImmutableOptions` and `MutableCFOptions`.
2. Make `daily_offpeak_time_utc` and `IsNowOffpeak()` available in `VersionStorageInfo`.

We chose the latter as it involves smaller changes.

This change includes the following
- Introduction of `OffpeakTimeInfo` and `IsNowOffpeak()` has been moved from `MutableDBOptions`
- `OffpeakTimeInfo` added to `VersionSet` and it can be set during construction and by `ChangeOffpeakTimeInfo()`
- During `SetDBOptions()`, if offpeak time info needs to change, it calls `MaybeScheduleFlushOrCompaction()` to re-compute compaction scores and process compactions as needed

Pull Request resolved: https://github.com/facebook/rocksdb/pull/12018

Test Plan:
- `DBOptionsTest::OffpeakTimes` changed to include checks for `MaybeScheduleFlushOrCompaction()` calls and `VersionSet`'s OffpeakTimeInfo value change during `SetDBOptions()`.
- `VersionSetTest::OffpeakTimeInfoTest` added to test `ChangeOffpeakTimeInfo()`. `IsNowOffpeak()` tests moved from `DBOptionsTest::OffpeakTimes`

Reviewed By: pdillinger

Differential Revision: D50723881

Pulled By: jaykorean

fbshipit-source-id: 3cff0291936f3729c0e9c7750834b9378fb435f6
2023-10-27 15:56:48 -07:00
..
cf_options.cc Add `CompressionOptions::checksum` for enabling ZSTD checksum (#11666) 2023-08-18 15:01:59 -07:00
cf_options.h Add a per column family default temperature option for accounting (#11708) 2023-08-17 17:06:57 -07:00
configurable.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
configurable_helper.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
configurable_test.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
configurable_test.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
customizable.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
customizable_test.cc Support compressed and local flash secondary cache stacking (#11812) 2023-09-21 20:30:53 -07:00
db_options.cc Make OffpeakTimeInfo available in VersionSet (#12018) 2023-10-27 15:56:48 -07:00
db_options.h Make OffpeakTimeInfo available in VersionSet (#12018) 2023-10-27 15:56:48 -07:00
offpeak_time_info.cc Make OffpeakTimeInfo available in VersionSet (#12018) 2023-10-27 15:56:48 -07:00
offpeak_time_info.h Make OffpeakTimeInfo available in VersionSet (#12018) 2023-10-27 15:56:48 -07:00
options.cc Add a per column family default temperature option for accounting (#11708) 2023-08-17 17:06:57 -07:00
options_helper.cc Offpeak in db option (#11893) 2023-09-29 13:03:39 -07:00
options_helper.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
options_parser.cc Delete temp OPTIONS file on failure to write it (#11423) 2023-05-12 22:39:39 -07:00
options_parser.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
options_settable_test.cc Offpeak in db option (#11893) 2023-09-29 13:03:39 -07:00
options_test.cc Offpeak in db option (#11893) 2023-09-29 13:03:39 -07:00