rocksdb/utilities
Yi Wu 4cb7068c1e BlobDB: Fix VisibleToActiveSnapshot() (#4236)
Summary:
There are two issues with `VisibleToActiveSnapshot`:
1. If there are no snapshots, `oldest_snapshot` will be 0 and `VisibleToActiveSnapshot` will always return true. Since the method is used to decide whether it is safe to delete obsolete files, obsolete file won't be able to delete in this case.
2. The `auto` keyword of `auto snapshots = db_impl_->snapshots()` translate to a copy of `const SnapshotList` instead of a reference. Since copy constructor of `SnapshotList` is not defined, using the copy may yield unexpected result.

Issue 2 actually hide issue 1 from being catch by tests. During test `snapshots.empty()` can return false while it should actually be empty, and `snapshots.oldest()` return an invalid address, making `oldest_snapshot` being some random large number.

The issue was originally reported by BlobDB early adopter at Kuaishou.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4236

Differential Revision: D9188706

Pulled By: yiwu-arbug

fbshipit-source-id: a0f2624b927cf9bf28c1bb534784fee5d106f5ea
2018-08-06 16:57:42 -07:00
..
backupable Improve FullFilterBitsReader::HashMayMatch's doc (#4202) 2018-08-06 11:13:18 -07:00
blob_db BlobDB: Fix VisibleToActiveSnapshot() (#4236) 2018-08-06 16:57:42 -07:00
cassandra Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
checkpoint Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
compaction_filters Comment out unused variables 2018-03-05 13:13:41 -08:00
convenience Change RocksDB License 2017-07-15 16:11:23 -07:00
date_tiered Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
document Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
geodb Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
leveldb_options Change RocksDB License 2017-07-15 16:11:23 -07:00
lua Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
memory Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
merge_operators Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
option_change_migration comment unused parameters to turn on -Wunused-parameter flag 2018-04-12 17:59:16 -07:00
options Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
persistent_cache Improve FullFilterBitsReader::HashMayMatch's doc (#4202) 2018-08-06 11:13:18 -07:00
redis Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
simulator_cache Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
spatialdb Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
table_properties_collectors Reduce runtime of compact_on_deletion_collector_test (#4117) 2018-07-11 23:41:58 -07:00
trace Trace and Replay for RocksDB (#3837) 2018-08-01 00:27:08 -07:00
transactions WriteUnPrepared: Implement unprepared batches for transactions (#4104) 2018-07-24 00:13:18 -07:00
ttl Per-thread unique test db names (#4135) 2018-07-13 17:27:39 -07:00
write_batch_with_index WriteUnPrepared: Implement unprepared batches for transactions (#4104) 2018-07-24 00:13:18 -07:00
col_buf_decoder.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
col_buf_decoder.h Comment out unused variables 2018-03-05 13:13:41 -08:00
col_buf_encoder.cc fix shift UBSAN error in col_buf_encoder.cc 2018-02-20 16:44:00 -08:00
col_buf_encoder.h Change RocksDB License 2017-07-15 16:11:23 -07:00
column_aware_encoding_exp.cc fix memory leak in two_level_iterator 2018-04-15 17:26:26 -07:00
column_aware_encoding_test.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
column_aware_encoding_util.cc Pin mmap files in ReadOnlyDB (#4053) 2018-06-27 17:13:34 -07:00
column_aware_encoding_util.h Move prefix_extractor to MutableCFOptions 2018-05-21 14:43:11 -07:00
debug.cc Fix naming in InternalKey 2017-09-12 17:17:42 -07:00
env_librados.cc Suppress lint in old files 2018-01-29 12:56:42 -08:00
env_librados.md Add EnvLibrados - RocksDB Env of RADOS (#1222) 2016-07-21 11:16:34 -07:00
env_librados_test.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
env_mirror.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
env_mirror_test.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
env_timed.cc comment unused parameters to turn on -Wunused-parameter flag 2018-04-12 17:59:16 -07:00
env_timed_test.cc fix memory leak in two_level_iterator 2018-04-15 17:26:26 -07:00
merge_operators.h Support StringAppendOperator(delimiter_char) constructor in java-api 2018-03-08 16:17:47 -08:00
object_registry_test.cc fix memory leak in two_level_iterator 2018-04-15 17:26:26 -07:00
util_merge_operators_test.cc Change RocksDB License 2017-07-15 16:11:23 -07:00