rocksdb/include/rocksdb
Peter Dillinger ad5325a736 Experimental support for SST unique IDs (#8990)
Summary:
* New public header unique_id.h and function GetUniqueIdFromTableProperties
which computes a universally unique identifier based on table properties
of table files from recent RocksDB versions.
* Generation of DB session IDs is refactored so that they are
guaranteed unique in the lifetime of a process running RocksDB.
(SemiStructuredUniqueIdGen, new test included.) Along with file numbers,
this enables SST unique IDs to be guaranteed unique among SSTs generated
in a single process, and "better than random" between processes.
See https://github.com/pdillinger/unique_id
* In addition to public API producing 'external' unique IDs, there is a function
for producing 'internal' unique IDs, with functions for converting between the
two. In short, the external ID is "safe" for things people might do with it, and
the internal ID enables more "power user" features for the future. Specifically,
the external ID goes through a hashing layer so that any subset of bits in the
external ID can be used as a hash of the full ID, while also preserving
uniqueness guarantees in the first 128 bits (bijective both on first 128 bits
and on full 192 bits).

Intended follow-up:
* Use the internal unique IDs in cache keys. (Avoid conflicts with https://github.com/facebook/rocksdb/issues/8912) (The file offset can be XORed into
the third 64-bit value of the unique ID.)
* Publish the external unique IDs in FileStorageInfo (https://github.com/facebook/rocksdb/issues/8968)

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

Test Plan:
Unit tests added, and checking of unique ids in stress test.
NOTE in stress test we do not generate nearly enough files to thoroughly
stress uniqueness, but the test trims off pieces of the ID to check for
uniqueness so that we can infer (with some assumptions) stronger
properties in the aggregate.

Reviewed By: zhichao-cao, mrambacher

Differential Revision: D31582865

Pulled By: pdillinger

fbshipit-source-id: 1f620c4c86af9abe2a8d177b9ccf2ad2b9f48243
2021-10-18 23:32:01 -07:00
..
utilities Add (Live)FileStorageInfo API (#8968) 2021-10-16 10:04:32 -07:00
advanced_options.h Mention a new BlobDB option in a couple of comments (#9038) 2021-10-14 16:01:13 -07:00
c.h Make it possible to force the garbage collection of the oldest blob files (#8994) 2021-10-11 18:03:01 -07:00
cache_bench_tool.h Allow cache_bench/db_bench to use a custom secondary cache (#8312) 2021-05-19 15:26:18 -07:00
cache.h Replace most typedef with using= (#8751) 2021-09-07 11:31:59 -07:00
cleanable.h Replace most typedef with using= (#8751) 2021-09-07 11:31:59 -07:00
compaction_filter.h Make MergeOperator+CompactionFilter/Factory into Customizable Classes (#8481) 2021-08-06 08:27:25 -07:00
compaction_job_stats.h Update compaction statistics to include the amount of data read from blob files (#8022) 2021-03-04 00:43:48 -08:00
comparator.h Make Comparator into a Customizable Object (#8336) 2021-06-11 06:22:59 -07:00
compression_type.h Move CompressionType to its own header file (#7162) 2020-08-03 15:49:31 -07:00
concurrent_task_limiter.h Make WalFilter, SstPartitionerFactory, FileChecksumGenFactory, and TableProperties Customizable (#8638) 2021-09-28 05:32:02 -07:00
configurable.h Make WalFilter, SstPartitionerFactory, FileChecksumGenFactory, and TableProperties Customizable (#8638) 2021-09-28 05:32:02 -07:00
convenience.h Add ObjectRegistry to ConfigOptions (#8166) 2021-05-11 06:47:22 -07:00
customizable.h Add support to the ObjectRegistry for ManagedObjects (#8658) 2021-09-10 05:21:04 -07:00
data_structure.h Add (Live)FileStorageInfo API (#8968) 2021-10-16 10:04:32 -07:00
db_bench_tool.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
db_dump_tool.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
db_stress_tool.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
db.h Make DB::Close() thread-safe (#8970) 2021-10-18 20:32:35 -07:00
env_encryption.h add IsSyncThreadSafe() override to EncryptedWritableFile (#8993) 2021-10-14 16:14:26 -07:00
env.h Protect existing files in FaultInjectionTest{Env,FS}::ReopenWritableFile() (#8995) 2021-10-11 16:23:18 -07:00
experimental.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
file_checksum.h Make WalFilter, SstPartitionerFactory, FileChecksumGenFactory, and TableProperties Customizable (#8638) 2021-09-28 05:32:02 -07:00
file_system.h Add property_bag to FileOptions (#9030) 2021-10-18 23:03:19 -07:00
filter_policy.h Add Bloom/Ribbon hybrid API support (#8679) 2021-08-20 18:00:16 -07:00
flush_block_policy.h Make FlushBlockPolicyFactory into a Customizable class (#8432) 2021-07-12 09:04:59 -07:00
functor_wrapper.h Fix and detect headers with missing dependencies (#8893) 2021-09-10 10:00:26 -07:00
io_status.h Add a new IOStatus subcode to indicate that writes are fenced off (#7374) 2020-09-14 16:04:47 -07:00
iostats_context.h Add file temperature related counter and bytes stats to and io_stats (#8710) 2021-10-07 14:58:41 -07:00
iterator.h Enable backward iterator for keys with user-defined timestamp (#8035) 2021-03-10 11:15:46 -08:00
ldb_tool.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
listener.h Make it possible to force the garbage collection of the oldest blob files (#8994) 2021-10-11 18:03:01 -07:00
memory_allocator.h slightly improve jemalloc allocator API header (#7592) 2020-10-28 13:47:12 -07:00
memtablerep.h Make MemTableRepFactory into a Customizable class (#8419) 2021-09-08 07:46:44 -07:00
merge_operator.h Make MergeOperator+CompactionFilter/Factory into Customizable Classes (#8481) 2021-08-06 08:27:25 -07:00
metadata.h Add (Live)FileStorageInfo API (#8968) 2021-10-16 10:04:32 -07:00
options.h Add (Live)FileStorageInfo API (#8968) 2021-10-16 10:04:32 -07:00
perf_context.h Add a PerfContext counter for secondary cache hits (#8685) 2021-08-20 15:17:30 -07:00
perf_level.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
persistent_cache.h Replace most typedef with using= (#8751) 2021-09-07 11:31:59 -07:00
rate_limiter.h Return Status::NotSupported() in RateLimiter::GetTotalPendingRequests default impl (#8950) 2021-09-22 19:36:06 -07:00
rocksdb_namespace.h Fix and detect headers with missing dependencies (#8893) 2021-09-10 10:00:26 -07:00
secondary_cache.h Make SecondaryCache Customizable (#8480) 2021-07-06 09:18:08 -07:00
slice_transform.h Add/improve misc comments (#8963) 2021-09-29 11:20:53 -07:00
slice.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
snapshot.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
sst_dump_tool.h Add --version and --help to ldb and sst_dump (#6951) 2020-06-09 10:04:01 -07:00
sst_file_manager.h Use SST file manager to track blob files as well (#8037) 2021-03-17 20:44:49 -07:00
sst_file_reader.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
sst_file_writer.h Support timestamps in SstFileWriter (#8899) 2021-09-09 18:58:01 -07:00
sst_partitioner.h Make WalFilter, SstPartitionerFactory, FileChecksumGenFactory, and TableProperties Customizable (#8638) 2021-09-28 05:32:02 -07:00
statistics.h Add remote compaction read/write bytes statistics (#8939) 2021-09-28 14:00:37 -07:00
stats_history.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
status.h Fix comments in Status (#8429) 2021-06-21 13:41:08 -07:00
system_clock.h Make SystemClock into a Customizable Class (#8636) 2021-09-21 09:23:48 -07:00
table_properties.h Support "level_at_creation" in TablePropertiesCollectorFactory::Context (#8919) 2021-09-28 12:35:24 -07:00
table.h Dynamically configure BlockBasedTableOptions.prepopulate_block_cache (#8620) 2021-08-05 19:44:51 -07:00
thread_status.h Fix and detect headers with missing dependencies (#8893) 2021-09-10 10:00:26 -07:00
threadpool.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
trace_reader_writer.h Update comments, fix typos. (#8721) 2021-08-27 13:16:32 -07:00
trace_record_result.h Add IteratorTraceExecutionResult for iterator related trace records. (#8687) 2021-08-20 15:35:56 -07:00
trace_record.h Add IteratorTraceExecutionResult for iterator related trace records. (#8687) 2021-08-20 15:35:56 -07:00
transaction_log.h Replace most typedef with using= (#8751) 2021-09-07 11:31:59 -07:00
types.h Expose blob file information through the EventListener interface (#8675) 2021-09-16 17:23:36 -07:00
unique_id.h Experimental support for SST unique IDs (#8990) 2021-10-18 23:32:01 -07:00
universal_compaction.h Fix and detect headers with missing dependencies (#8893) 2021-09-10 10:00:26 -07:00
version.h Update version to 6.25.0 (#8935) 2021-09-20 11:22:41 -07:00
wal_filter.h Make WalFilter, SstPartitionerFactory, FileChecksumGenFactory, and TableProperties Customizable (#8638) 2021-09-28 05:32:02 -07:00
write_batch_base.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
write_batch.h Allow WriteBatch to have keys with different timestamp sizes (#8725) 2021-09-12 15:34:26 -07:00
write_buffer_manager.h Fix race in WriteBufferManager (#9009) 2021-10-12 00:16:21 -07:00