rocksdb/db_stress_tool
Peter Dillinger 2a383f21f4 Add Bloom/Ribbon hybrid API support (#8679)
Summary:
This is essentially resurrection and fixing of the part of
https://github.com/facebook/rocksdb/issues/8198 that was reverted in https://github.com/facebook/rocksdb/issues/8212, using data added in https://github.com/facebook/rocksdb/issues/8246. Basically,
when configuring Ribbon filter, you can specify an LSM level before which
Bloom will be used instead of Ribbon. But Bloom is only considered for
Leveled and Universal compaction styles and file going into a known LSM
level. This way, SST file writer, FIFO compaction, etc. use Ribbon filter as
you would expect with NewRibbonFilterPolicy.

So that this can be controlled with a single int value and so that flushes
can be distinguished from intra-L0, we consider flush to go to level -1 for
the purposes of this option. (Explained in API comment.)

I also expect the most common and recommended Ribbon configuration to
use Bloom during flush, to minimize slowing down writes and because according
to my estimates, Ribbon only pays off if the structure lives in memory for
more than an hour. Thus, I have changed the default for NewRibbonFilterPolicy
to be this mild hybrid configuration. I don't really want to add something like
NewHybridFilterPolicy because at least the mild hybrid configuration (Bloom for
flush, Ribbon otherwise) should be considered a natural choice.

C APIs also updated, but because they don't support overloading,
rocksdb_filterpolicy_create_ribbon is kept pure ribbon for clarity and
rocksdb_filterpolicy_create_ribbon_hybrid must be called for a hybrid
configuration. While touching C API, I changed bits per key options from
int to double.

BuiltinFilterPolicy is needed so that LevelThresholdFilterPolicy doesn't inherit
unused fields from BloomFilterPolicy.

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

Test Plan: new + updated tests, including crash test

Reviewed By: jay-zhuang

Differential Revision: D30445797

Pulled By: pdillinger

fbshipit-source-id: 6f5aeddfd6d79f7e55493b563c2d1d2d568892e1
2021-08-20 18:00:16 -07:00
..
batched_ops_stress.cc Integrity protection for live updates to WriteBatch (#7748) 2021-01-29 12:18:58 -08:00
cf_consistency_stress.cc Fix cf_consistency_stress for backup/restore, harmonize (#7373) 2020-09-10 22:55:06 -07:00
CMakeLists.txt Mark dependencies as PRIVATE and fix missing dependencies in tools. (#6790) 2020-05-12 21:07:55 -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 Add Bloom/Ribbon hybrid API support (#8679) 2021-08-20 18:00:16 -07:00
db_stress_compaction_filter.h Fix unused variable failure (#7004) 2020-06-18 22:06:51 -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 Add Bloom/Ribbon hybrid API support (#8679) 2021-08-20 18:00:16 -07:00
db_stress_listener.h Make EventListener into a Customizable Class (#8473) 2021-07-27 07:47:02 -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 Stress test to inject read failures in DB reopen (#8476) 2021-07-06 11:05:27 -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 Mark files for compaction in stress/crash tests (#7231) 2020-08-10 16:17:56 -07:00
db_stress_test_base.cc Add Bloom/Ribbon hybrid API support (#8679) 2021-08-20 18:00:16 -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 Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
no_batched_ops_stress.cc Inject fatal write failures to db_stress when DB is running (#8479) 2021-07-01 14:16:47 -07:00