rocksdb/util
Peter Dillinger 126c223714 Remove deprecated block-based filter (#10184)
Summary:
In https://github.com/facebook/rocksdb/issues/9535, release 7.0, we hid the old block-based filter from being created using
the public API, because of its inefficiency. Although we normally maintain read compatibility
on old DBs forever, filters are not required for reading a DB, only for optimizing read
performance. Thus, it should be acceptable to remove this code and the substantial
maintenance burden it carries as useful features are developed and validated (such
as user timestamp).

This change completely removes the code for reading and writing the old block-based
filters, net removing about 1370 lines of code no longer needed. Options removed from
testing / benchmarking tools. The prior existence is only evident in a couple of places:
* `CacheEntryRole::kDeprecatedFilterBlock` - We can update this public API enum in
a major release to minimize source code incompatibilities.
* A warning is logged when an old table file is opened that used the old block-based
filter. This is provided as a courtesy, and would be a pain to unit test, so manual testing
should suffice. Unfortunately, sst_dump does not tell you whether a file uses
block-based filter, and the structure of the code makes it very difficult to fix.
* To detect that case, `kObsoleteFilterBlockPrefix` (renamed from `kFilterBlockPrefix`)
for metaindex is maintained (for now).

Other notes:
* In some cases where numbers are associated with filter configurations, we have had to
update the assigned numbers so that they all correspond to something that exists.
* Fixed potential stat counting bug by assuming `filter_checked = false` for cases
like `filter == nullptr` rather than assuming `filter_checked = true`
* Removed obsolete `block_offset` and `prefix_extractor` parameters from several
functions.
* Removed some unnecessary checks `if (!table_prefix_extractor() && !prefix_extractor)`
because the caller guarantees the prefix extractor exists and is compatible

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

Test Plan:
tests updated, manually test new warning in LOG using base version to
generate a DB

Reviewed By: riversand963

Differential Revision: D37212647

Pulled By: pdillinger

fbshipit-source-id: 06ee020d8de3b81260ffc36ad0c1202cbf463a80
2022-06-16 15:51:33 -07:00
..
aligned_buffer.h
async_file_reader.cc
async_file_reader.h
autovector.h
autovector_test.cc
bloom_impl.h
bloom_test.cc
build_version.cc.in
cast_util.h
channel.h
cleanable.cc
coding.cc
coding.h
coding_lean.h
coding_test.cc
compaction_job_stats_impl.cc
comparator.cc
compression.cc
compression.h
compression_context_cache.cc
compression_context_cache.h
concurrent_task_limiter_impl.cc
concurrent_task_limiter_impl.h
core_local.h
coro_utils.h
crc32c.cc
crc32c.h
crc32c_arm64.cc
crc32c_arm64.h
crc32c_ppc.c
crc32c_ppc.h
crc32c_ppc_asm.S
crc32c_ppc_constants.h
crc32c_test.cc
defer.h
defer_test.cc
duplicate_detector.h
dynamic_bloom.cc
dynamic_bloom.h
dynamic_bloom_test.cc
fastrange.h
file_checksum_helper.cc
file_checksum_helper.h
file_reader_writer_test.cc
filelock_test.cc
filter_bench.cc
gflags_compat.h
hash.cc
hash.h
hash128.h
hash_containers.h
hash_map.h
hash_test.cc
heap.h
heap_test.cc
kv_map.h
log_write_bench.cc
math.h
math128.h
murmurhash.cc
murmurhash.h
mutexlock.h
ppc-opcode.h
random.cc
random.h
random_test.cc
rate_limiter.cc
rate_limiter.h
rate_limiter_test.cc
repeatable_thread.h
repeatable_thread_test.cc
ribbon_alg.h
ribbon_config.cc
ribbon_config.h
ribbon_impl.h
ribbon_test.cc
set_comparator.h
single_thread_executor.h
slice.cc
slice_test.cc
slice_transform_test.cc
status.cc
stderr_logger.h
stop_watch.h
string_util.cc
string_util.h
thread_guard.h
thread_list_test.cc
thread_local.cc
thread_local.h
thread_local_test.cc
thread_operation.h
threadpool_imp.cc
threadpool_imp.h
timer.h
timer_queue.h
timer_queue_test.cc
timer_test.cc
user_comparator_wrapper.h
vector_iterator.h
work_queue.h
work_queue_test.cc
xxhash.cc
xxhash.h
xxph3.h