rocksdb/util
Peter Dillinger a8a422e962 Add manifest fix-up utility for file temperatures (#9683)
Summary:
The goal of this change is to allow changes to the "current" (in
FileSystem) file temperatures to feed back into DB metadata, so that
they can inform decisions and stats reporting. In part because of
modular code factoring, it doesn't seem easy to do this automagically,
where opening an SST file and observing current Temperature different
from expected would trigger a change in metadata and DB manifest write
(essentially giving the deep read path access to the write path). It is also
difficult to do this while the DB is open because of the limitations of
LogAndApply.

This change allows updating file temperature metadata on a closed DB
using an experimental utility function UpdateManifestForFilesState()
or `ldb update_manifest --update_temperatures`. This should suffice for
"migration" scenarios where outside tooling has placed or re-arranged DB
files into a (different) tiered configuration without going through
RocksDB itself (currently, only compaction can change temperature
metadata).

Some details:
* Refactored and added unit test for `ldb unsafe_remove_sst_file` because
of shared functionality
* Pulled in autovector.h changes from https://github.com/facebook/rocksdb/issues/9546 to fix SuperVersionContext
move constructor (related to an older draft of this change)

Possible follow-up work:
* Support updating manifest with file checksums, such as when a
new checksum function is used and want existing DB metadata updated
for it.
* It's possible that for some repair scenarios, lighter weight than
full repair, we might want to support UpdateManifestForFilesState() to
modify critical file details like size or checksum using same
algorithm. But let's make sure these are differentiated from modifying
file details in ways that don't suspect corruption (or require extreme
trust).

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

Test Plan: unit tests added

Reviewed By: jay-zhuang

Differential Revision: D34798828

Pulled By: pdillinger

fbshipit-source-id: cfd83e8fb10761d8c9e7f9c020d68c9106a95554
2022-03-18 16:35:51 -07:00
..
aligned_buffer.h
autovector.h Add manifest fix-up utility for file temperatures (#9683) 2022-03-18 16:35:51 -07:00
autovector_test.cc
bloom_impl.h FilterPolicy API changes for 7.0 (#9501) 2022-02-08 13:56:46 -08:00
bloom_test.cc Make FilterPolicy Customizable (#9590) 2022-02-18 13:22:31 -08:00
build_version.cc.in
cast_util.h More refactoring ahead of footer & meta changes (#9240) 2021-12-10 08:13:26 -08:00
channel.h
coding.cc
coding.h More refactoring ahead of footer & meta changes (#9240) 2021-12-10 08:13:26 -08:00
coding_lean.h New stable, fixed-length cache keys (#9126) 2021-12-16 17:15:13 -08:00
coding_test.cc
compaction_job_stats_impl.cc
comparator.cc Return different Status based on ObjectRegistry::NewObject calls (#9333) 2022-02-11 05:11:24 -08:00
compression.cc Integrate WAL compression into log reader/writer. (#9642) 2022-03-09 15:49:53 -08:00
compression.h Minor fix for Windows build with zlib (#9699) 2022-03-16 21:16:12 -07:00
compression_context_cache.cc Remove using namespace (#9369) 2022-01-12 09:31:12 -08:00
compression_context_cache.h
concurrent_task_limiter_impl.cc
concurrent_task_limiter_impl.h
core_local.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 Fix major bug with MultiGet, DeleteRange, and memtable Bloom (#9453) 2022-01-27 14:55:04 -08:00
dynamic_bloom_test.cc
fastrange.h
file_checksum_helper.cc Restore Regex support for ObjectLibrary::Register, rename new APIs to allow old one to be deprecated in the future (#9362) 2022-01-11 06:33:48 -08:00
file_checksum_helper.h New stable, fixed-length cache keys (#9126) 2021-12-16 17:15:13 -08:00
file_reader_writer_test.cc Disallow a combination of options (#9348) 2022-01-27 19:30:24 -08:00
filelock_test.cc
filter_bench.cc Refactor FilterPolicies toward Customizable (#9567) 2022-02-16 08:30:03 -08:00
gflags_compat.h Require C++17 (#9481) 2022-02-04 17:13:10 -08:00
hash.cc
hash.h
hash128.h
hash_map.h
hash_test.cc New stable, fixed-length cache keys (#9126) 2021-12-16 17:15:13 -08:00
heap.h
heap_test.cc
kv_map.h
log_write_bench.cc
math.h Avoid popcnt on Windows when unavailable and in portable builds (#9680) 2022-03-09 21:07:31 -08:00
math128.h New stable, fixed-length cache keys (#9126) 2021-12-16 17:15:13 -08:00
murmurhash.cc
murmurhash.h
mutexlock.h
ppc-opcode.h
random.cc
random.h
random_test.cc
rate_limiter.cc remove unused instance variable in GenericRateLimiter (#9484) 2022-02-01 14:04:12 -08:00
rate_limiter.h remove unused instance variable in GenericRateLimiter (#9484) 2022-02-01 14:04:12 -08:00
rate_limiter_test.cc Make RateLimiter Customizable (#9141) 2021-12-01 06:57:02 -08:00
repeatable_thread.h
repeatable_thread_test.cc
ribbon_alg.h
ribbon_config.cc
ribbon_config.h
ribbon_impl.h Account Bloom/Ribbon filter construction memory in global memory limit (#9073) 2021-11-18 09:42:20 -08:00
ribbon_test.cc
set_comparator.h
slice.cc Fix LITE build for SliceTransform::AsString (#9460) 2022-01-27 16:58:22 -08:00
slice_test.cc Require C++17 (#9481) 2022-02-04 17:13:10 -08:00
slice_transform_test.cc
status.cc Combine data members of IOStatus with Status (#9549) 2022-02-22 11:23:01 -08:00
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 Remove incremental ID from background thread pool names (#9165) 2021-11-16 18:26:12 -08:00
threadpool_imp.h
timer.h Fix a timer crash caused by invalid memory management (#9656) 2022-03-12 11:45:56 -08:00
timer_queue.h
timer_queue_test.cc
timer_test.cc Fix a timer crash caused by invalid memory management (#9656) 2022-03-12 11:45:56 -08:00
user_comparator_wrapper.h
vector_iterator.h
work_queue.h
work_queue_test.cc
xxhash.cc
xxhash.h
xxph3.h