rocksdb/options
Peter Dillinger ac24f152a1 Refactor `table_factory` into MutableCFOptions (#13077)
Summary:
This is setting up for a fix to a data race in SetOptions on BlockBasedTableOptions (BBTO), https://github.com/facebook/rocksdb/issues/10079
The race will be fixed by replacing `table_factory` with a modified copy whenever we want to modify a BBTO field.

An argument could be made that this change creates more entaglement between features (e.g. BlobSource <-> MutableCFOptions), rather than (conceptually) minimizing the dependencies of each feature, but
* Most of these things already depended on ImmutableOptions
* Historically there has been a lot of plumbing (and possible small CPU overhead) involved in adding features that need to reach a lot of places, like `block_protection_bytes_per_key`. Keeping those wrapped up in options simplifies that.
* SuperVersion management generally takes care of lifetime management of MutableCFOptions, so is not that difficult. (Crash test agrees so far.)

There are some FIXME places where it is known to be unsafe to replace `block_cache` unless/until we handle shared_ptr tracking properly. HOWEVER, replacing `block_cache` is generally dubious, at least while existing users of the old block cache (e.g. table readers) can continue indefinitely.

The change to cf_options.cc is essentially just moving code (not changing).

I'm not concerned about the performance of copying another shared_ptr with MutableCFOptions, but I left a note about considering an improvement if more shared_ptr are added to it.

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

Test Plan:
existing tests, crash test.

Unit test DBOptionsTest.GetLatestCFOptions updated with some temporary logic. MemoryTest required some refactoring (simplification) for the change.

Reviewed By: cbi42

Differential Revision: D64546903

Pulled By: pdillinger

fbshipit-source-id: 69ae97ce5cf4c01b58edc4c5d4687eb1e5bf5855
2024-10-17 14:13:20 -07:00
..
cf_options.cc Refactor `table_factory` into MutableCFOptions (#13077) 2024-10-17 14:13:20 -07:00
cf_options.h Refactor `table_factory` into MutableCFOptions (#13077) 2024-10-17 14:13:20 -07:00
configurable.cc internal_repo_rocksdb (-8794174668376270091) (#12114) 2023-12-01 11:10:30 -08:00
configurable_helper.h
configurable_test.cc Run internal cpp modernizer on RocksDB repo (#12398) 2024-03-04 10:08:32 -08:00
configurable_test.h internal_repo_rocksdb (-8794174668376270091) (#12114) 2023-12-01 11:10:30 -08:00
customizable.cc Prefer static_cast in place of most reinterpret_cast (#12308) 2024-02-07 10:44:11 -08:00
customizable_test.cc Make Cache a customizable class (#13024) 2024-09-20 12:13:19 -07:00
db_options.cc Steps toward deprecating implicit prefix seek, related fixes (#13026) 2024-09-20 15:54:19 -07:00
db_options.h Steps toward deprecating implicit prefix seek, related fixes (#13026) 2024-09-20 15:54:19 -07:00
offpeak_time_info.cc
offpeak_time_info.h Fix build on alpine 3.19 (#12345) 2024-02-12 11:24:56 -08:00
options.cc Improve universal compaction sorted-run trigger (#12477) 2024-05-24 10:10:31 -07:00
options_helper.cc Refactor `table_factory` into MutableCFOptions (#13077) 2024-10-17 14:13:20 -07:00
options_helper.h Bug fix and test BuildDBOptions (#13038) 2024-09-26 14:36:29 -07:00
options_parser.cc Fix and clarify ignore_unknown_options (#12989) 2024-09-04 11:42:04 -07:00
options_parser.h Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
options_settable_test.cc Bug fix and test BuildDBOptions (#13038) 2024-09-26 14:36:29 -07:00
options_test.cc Make simple BlockBasedTableOptions mutable (#10021) 2024-10-14 17:49:26 -07:00