rocksdb/utilities
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
..
agg_merge
backup Avoid unnecessary work in internal calls to GetSortedWalFiles (#12831) 2024-07-01 23:29:02 -07:00
blob_db Fix file deletions in DestroyDB not rate limited (#12891) 2024-08-02 19:31:55 -07:00
cassandra
checkpoint Fix failure to clean the temporary directory due to NotFound in crash test checkpoint creation (#12919) 2024-08-08 15:37:19 -07:00
compaction_filters
convenience
leveldb_options
memory Refactor table_factory into MutableCFOptions (#13077) 2024-10-17 14:13:20 -07:00
merge_operators
option_change_migration
options
persistent_cache
simulator_cache
table_properties_collectors Remove unreachable code (#12846) 2024-07-09 09:24:43 -07:00
trace
transactions Do not add unprep_seqs when WriteImpl() fails in unprepared txn (#12927) 2024-08-15 09:16:29 -07:00
ttl
write_batch_with_index Fix compile errors in C++23 (#12106) 2024-05-28 15:33:57 -07:00
cache_dump_load.cc
cache_dump_load_impl.cc Add dump all keys for cache dumper impl (#12500) 2024-04-12 10:47:13 -07:00
cache_dump_load_impl.h Add dump all keys for cache dumper impl (#12500) 2024-04-12 10:47:13 -07:00
compaction_filters.cc
counted_fs.cc
counted_fs.h
debug.cc Add timestamp support in dump_wal/dump/idump (#12690) 2024-05-23 20:26:57 -07:00
env_mirror.cc
env_mirror_test.cc
env_timed.cc
env_timed.h
env_timed_test.cc
fault_injection_env.cc
fault_injection_env.h
fault_injection_fs.cc Fix non-ASCII character (#12972) 2024-09-03 14:41:55 -07:00
fault_injection_fs.h Handle injected write error after successful WAL write in crash test + misc (#12838) 2024-07-29 13:51:49 -07:00
fault_injection_secondary_cache.cc
fault_injection_secondary_cache.h
memory_allocators.h
merge_operators.cc
merge_operators.h
object_registry.cc
object_registry_test.cc
types_util.cc
types_util_test.cc
util_merge_operators_test.cc
wal_filter.cc