rocksdb/db_stress_tool
Levi Tamasi 3e1bf771a3 Make it possible to force the garbage collection of the oldest blob files (#8994)
Summary:
The current BlobDB garbage collection logic works by relocating the valid
blobs from the oldest blob files as they are encountered during compaction,
and cleaning up blob files once they contain nothing but garbage. However,
with sufficiently skewed workloads, it is theoretically possible to end up in a
situation when few or no compactions get scheduled for the SST files that contain
references to the oldest blob files, which can lead to increased space amp due
to the lack of GC.

In order to efficiently handle such workloads, the patch adds a new BlobDB
configuration option called `blob_garbage_collection_force_threshold`,
which signals to BlobDB to schedule targeted compactions for the SST files
that keep alive the oldest batch of blob files if the overall ratio of garbage in
the given blob files meets the threshold *and* all the given blob files are
eligible for GC based on `blob_garbage_collection_age_cutoff`. (For example,
if the new option is set to 0.9, targeted compactions will get scheduled if the
sum of garbage bytes meets or exceeds 90% of the sum of total bytes in the
oldest blob files, assuming all affected blob files are below the age-based cutoff.)
The net result of these targeted compactions is that the valid blobs in the oldest
blob files are relocated and the oldest blob files themselves cleaned up (since
*all* SST files that rely on them get compacted away).

These targeted compactions are similar to periodic compactions in the sense
that they force certain SST files that otherwise would not get picked up to undergo
compaction and also in the sense that instead of merging files from multiple levels,
they target a single file. (Note: such compactions might still include neighboring files
from the same level due to the need of having a "clean cut" boundary but they never
include any files from any other level.)

This functionality is currently only supported with the leveled compaction style
and is inactive by default (since the default value is set to 1.0, i.e. 100%).

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

Test Plan: Ran `make check` and tested using `db_bench` and the stress/crash tests.

Reviewed By: riversand963

Differential Revision: D31489850

Pulled By: ltamasi

fbshipit-source-id: 44057d511726a0e2a03c5d9313d7511b3f0c4eab
2021-10-11 18:03:01 -07:00
..
batched_ops_stress.cc Allow WriteBatch to have keys with different timestamp sizes (#8725) 2021-09-12 15:34:26 -07:00
cf_consistency_stress.cc Fix cf_consistency_stress for backup/restore, harmonize (#7373) 2020-09-10 22:55:06 -07:00
CMakeLists.txt Refactor expected state in stress/crash test (#8913) 2021-09-28 14:13:33 -07:00
db_stress_common.cc Add user-defined timestamps to db_stress (#8061) 2021-03-23 05:13:30 -07:00
db_stress_common.h Make it possible to force the garbage collection of the oldest blob files (#8994) 2021-10-11 18:03:01 -07:00
db_stress_compaction_filter.h Prevent deadlock in db_stress with DbStressCompactionFilter (#8956) 2021-09-24 16:54:02 -07:00
db_stress_driver.cc Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
db_stress_driver.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
db_stress_env_wrapper.h db_stress to add --open_metadata_write_fault_one_in (#8235) 2021-04-28 10:58:05 -07:00
db_stress_gflags.cc Make it possible to force the garbage collection of the oldest blob files (#8994) 2021-10-11 18:03:01 -07:00
db_stress_listener.h Fix and detect headers with missing dependencies (#8893) 2021-09-10 10:00:26 -07:00
db_stress_shared_state.cc Silence false alarms in db_stress fault injection (#6741) 2020-04-24 13:06:12 -07:00
db_stress_shared_state.h Refactor expected state in stress/crash test (#8913) 2021-09-28 14:13:33 -07:00
db_stress_stat.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
db_stress_table_properties_collector.h Fix and detect headers with missing dependencies (#8893) 2021-09-10 10:00:26 -07:00
db_stress_test_base.cc Make it possible to force the garbage collection of the oldest blob files (#8994) 2021-10-11 18:03:01 -07:00
db_stress_test_base.h Inject fatal write failures to db_stress when DB is running (#8479) 2021-07-01 14:16:47 -07:00
db_stress_tool.cc Stress test to inject read failures in DB reopen (#8476) 2021-07-06 11:05:27 -07:00
db_stress.cc Add (& fix) some simple source code checks (#8821) 2021-09-07 21:19:27 -07:00
expected_state.cc Refactor expected state in stress/crash test (#8913) 2021-09-28 14:13:33 -07:00
expected_state.h Refactor expected state in stress/crash test (#8913) 2021-09-28 14:13:33 -07:00
no_batched_ops_stress.cc Improve fault injection to MultiRead (#8937) 2021-09-21 14:48:15 -07:00