rocksdb/options
Jay Huh 2dab137182 Mark more files for periodic compaction during offpeak (#12031)
Summary:
- The struct previously named `OffpeakTimeInfo` has been renamed to `OffpeakTimeOption` to indicate that it's a user-configurable option. Additionally, a new struct, `OffpeakTimeInfo`, has been introduced, which includes two fields: `is_now_offpeak` and `seconds_till_next_offpeak_start`. This change prevents the need to parse the `daily_offpeak_time_utc` string twice.
- It's worth noting that we may consider adding more fields to the `OffpeakTimeInfo` struct, such as `elapsed_seconds` and `total_seconds`, as needed for further optimization.
- Within `VersionStorageInfo::ComputeFilesMarkedForPeriodicCompaction()`, we've adjusted the `allowed_time_limit` to include files that are expected to expire by the next offpeak start.
- We might explore further optimizations, such as evenly distributing files to mark during offpeak hours, if the initial approach results in marking too many files simultaneously during the first scoring in offpeak hours. The primary objective of this PR is to prevent periodic compactions during non-offpeak hours when offpeak hours are configured. We'll start with this straightforward solution and assess whether it suffices for now.

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

Test Plan:
Unit Tests added
- `DBCompactionTest::LevelPeriodicCompactionOffpeak` for Leveled
- `DBTestUniversalCompaction2::PeriodicCompaction` for Universal

Reviewed By: cbi42

Differential Revision: D50900292

Pulled By: jaykorean

fbshipit-source-id: 267e7d3332d45a5d9881796786c8650fa0a3b43d
2023-11-06 11:43:59 -08:00
..
cf_options.cc Save the correct user comparator name in OPTIONS file (#12037) 2023-11-02 13:27: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 Mark more files for periodic compaction during offpeak (#12031) 2023-11-06 11:43:59 -08:00
offpeak_time_info.h Mark more files for periodic compaction during offpeak (#12031) 2023-11-06 11:43:59 -08: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 Save the correct user comparator name in OPTIONS file (#12037) 2023-11-02 13:27:59 -07:00