rocksdb/utilities/blob_db
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
..
blob_compaction_filter.cc Blob DB: Improve FIFO eviction 2018-03-06 11:57:42 -08:00
blob_compaction_filter.h Blob DB: Improve FIFO eviction 2018-03-06 11:57:42 -08:00
blob_db_impl.cc BlobDB: Fix VisibleToActiveSnapshot() (#4236) 2018-08-06 16:57:42 -07:00
blob_db_impl.h BlobDB: Cleanup TTLExtractor interface (#4229) 2018-08-06 11:58:05 -07:00
blob_db_iterator.h Change and clarify the relationship between Valid(), status() and Seek*() for all iterators. Also fix some bugs 2018-05-17 02:56:56 -07:00
blob_db_listener.h Blob DB: Improve FIFO eviction 2018-03-06 11:57:42 -08:00
blob_db_test.cc BlobDB: Cleanup TTLExtractor interface (#4229) 2018-08-06 11:58:05 -07:00
blob_db.cc BlobDB: Cleanup TTLExtractor interface (#4229) 2018-08-06 11:58:05 -07:00
blob_db.h BlobDB: Cleanup TTLExtractor interface (#4229) 2018-08-06 11:58:05 -07:00
blob_dump_tool.cc Blob DB: enable readahead for garbage collection (#3648) 2018-06-23 23:12:00 -07:00
blob_dump_tool.h Blob DB: blob_dump to show uncompressed values 2018-04-05 11:12:16 -07:00
blob_file.cc Blob DB: enable readahead for garbage collection (#3648) 2018-06-23 23:12:00 -07:00
blob_file.h BlobDB: is_fifo=true also evict non-TTL blob files (#4049) 2018-06-25 22:43:05 -07:00
blob_index.h Blob DB: Inline small values in base DB 2017-10-26 12:30:54 -07:00
blob_log_format.cc BlobDB: Remove the need to get sequence number per write 2017-12-15 13:27:30 -08:00
blob_log_format.h BlobDB: Remove the need to get sequence number per write 2017-12-15 13:27:30 -08:00
blob_log_reader.cc Blob DB: enable readahead for garbage collection (#3648) 2018-06-23 23:12:00 -07:00
blob_log_reader.h Blob DB: enable readahead for garbage collection (#3648) 2018-06-23 23:12:00 -07:00
blob_log_writer.cc BlobDB: refactor DB open logic 2017-12-11 12:12:38 -08:00
blob_log_writer.h BlobDB: refactor DB open logic 2017-12-11 12:12:38 -08:00