mirror of https://github.com/facebook/rocksdb.git
8a36543326
Summary: Follow-up to https://github.com/facebook/rocksdb/issues/13114 This change makes the options mutable in testing only through some internal hooks, so that we can keep the easier mechanics and testing of making the options mutable separate from a more interesting and critical fix needed for the options to be *safely* mutable. See https://github.com/facebook/rocksdb/pull/9964/files#r1024449523 for some background on the interesting remaining problem, which we've added a test for here, with the failing piece commented out (because it puts the DB in a failure state): PrecludeLastLevelTest.RangeTombstoneSnapshotMigrateFromLast. The mechanics of making the options mutable turned out to be smaller than expected because `RegisterRecordSeqnoTimeWorker()` and `RecordSeqnoToTimeMapping()` are already robust to things like frequently switching between preserve/preclude durations e.g. with new and dropped column families, based on work from https://github.com/facebook/rocksdb/issues/11920, https://github.com/facebook/rocksdb/issues/11929, and https://github.com/facebook/rocksdb/issues/12253. Mostly, `options_mutex_` prevents races in applying the options changes, and smart capacity enforcement in `SeqnoToTimeMapping` means it doesn't really matter if the periodic task wakes up too often by being re-scheduled repeatedly. Functional changes needed other than marking mutable: * Update periodic task registration (as needed) from SetOptions, with a mapping recorded then also in case it's needed. * Install SuperVersion(s) with updated mapping when the registration function itself updates the mapping. Possible follow-up (aside from already mentioned): * Some FIXME code in RangeTombstoneSnapshotMigrateFromLast is present because Flush does not automatically include a seqno to time mapping entry that puts an upper bound on how new the flushed data is. This has the potential to be a measurable CPU impact so needs to be done carefully. Pull Request resolved: https://github.com/facebook/rocksdb/pull/13124 Test Plan: updated/refactored tests in tiered_compaction_test to parametrically use dynamic configuration changes (or DB restarts) when changing operating parameters such as these. CheckInternalKeyRange test got some heavier refactoring in preparation for follow-up, and manually verified that the test still fails when relevant `if (!safe_to_penultimate_level) ...` code is disabled. Reviewed By: jowlyzhang Differential Revision: D65634146 Pulled By: pdillinger fbshipit-source-id: 25c9d00fd5b7fd1b408b5f36d58dc48647970528 |
||
---|---|---|
.. | ||
clipping_iterator.h | ||
clipping_iterator_test.cc | ||
compaction.cc | ||
compaction.h | ||
compaction_iteration_stats.h | ||
compaction_iterator.cc | ||
compaction_iterator.h | ||
compaction_iterator_test.cc | ||
compaction_job.cc | ||
compaction_job.h | ||
compaction_job_stats_test.cc | ||
compaction_job_test.cc | ||
compaction_outputs.cc | ||
compaction_outputs.h | ||
compaction_picker.cc | ||
compaction_picker.h | ||
compaction_picker_fifo.cc | ||
compaction_picker_fifo.h | ||
compaction_picker_level.cc | ||
compaction_picker_level.h | ||
compaction_picker_test.cc | ||
compaction_picker_universal.cc | ||
compaction_picker_universal.h | ||
compaction_service_job.cc | ||
compaction_service_test.cc | ||
compaction_state.cc | ||
compaction_state.h | ||
file_pri.h | ||
sst_partitioner.cc | ||
subcompaction_state.cc | ||
subcompaction_state.h | ||
tiered_compaction_test.cc |