rocksdb/options
anand76 d8fb849b7e Basic RocksDB follower implementation (#12540)
Summary:
A basic implementation of RocksDB follower mode, which opens a remote database (referred to as leader) on a distributed file system by tailing its MANIFEST. It leverages the secondary instance mode, but is different in some key ways -
1. It has its own directory with links to the leader's database
2. Periodically refreshes itself
3. (Future) Snapshot support
4. (Future) Garbage collection of obsolete links
5. (Long term) Memtable replication

There are two main classes implementing this functionality - `DBImplFollower` and `OnDemandFileSystem`. The former is derived from `DBImplSecondary`. Similar to `DBImplSecondary`, it implements recovery and catch up through MANIFEST tailing using the `ReactiveVersionSet`, but does not consider logs. In a future PR, we will implement memtable replication, which will eliminate the need to catch up using logs. In addition, the recovery and catch-up tries to avoid directory listing as repeated metadata operations are expensive.

The second main piece is the `OnDemandFileSystem`, which plugs in as an `Env` for the follower instance and creates the illusion of the follower directory as a clone of the leader directory. It creates links to SSTs on first reference. When the follower tails the MANIFEST and attempts to create a new `Version`, it calls `VerifyFileMetadata` to verify the size of the file, and optionally the unique ID of the file. During this process, links are created which prevent the underlying files from getting deallocated even if the leader deletes the files.

TODOs: Deletion of obsolete links, snapshots, robust checking against misconfigurations, better observability etc.

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

Reviewed By: jowlyzhang

Differential Revision: D56315718

Pulled By: anand1976

fbshipit-source-id: d19e1aca43a6af4000cb8622a718031b69ebd97b
2024-04-19 19:13:31 -07:00
..
cf_options.cc default_write_temperature option (#12388) 2024-02-28 14:36:13 -08:00
cf_options.h default_write_temperature option (#12388) 2024-02-28 14:36:13 -08:00
configurable.cc internal_repo_rocksdb (-8794174668376270091) (#12114) 2023-12-01 11:10:30 -08:00
configurable_helper.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
configurable_test.cc Run internal cpp modernizer on RocksDB repo (#12398) 2024-03-04 10:08:32 -08:00
configurable_test.h internal_repo_rocksdb (-8794174668376270091) (#12114) 2023-12-01 11:10:30 -08:00
customizable.cc Prefer static_cast in place of most reinterpret_cast (#12308) 2024-02-07 10:44:11 -08:00
customizable_test.cc Add some compressed and tiered secondary cache stats (#12150) 2023-12-15 11:34:08 -08:00
db_options.cc Basic RocksDB follower implementation (#12540) 2024-04-19 19:13:31 -07:00
db_options.h Basic RocksDB follower implementation (#12540) 2024-04-19 19:13:31 -07:00
offpeak_time_info.cc Mark more files for periodic compaction during offpeak (#12031) 2023-11-06 11:43:59 -08:00
offpeak_time_info.h Fix build on alpine 3.19 (#12345) 2024-02-12 11:24:56 -08:00
options.cc default_write_temperature option (#12388) 2024-02-28 14:36:13 -08:00
options_helper.cc default_write_temperature option (#12388) 2024-02-28 14:36:13 -08:00
options_helper.h Remove unnecessary, confusing 'extern' (#12300) 2024-01-29 10:38:08 -08:00
options_parser.cc Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
options_parser.h Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
options_settable_test.cc default_write_temperature option (#12388) 2024-02-28 14:36:13 -08:00
options_test.cc default_write_temperature option (#12388) 2024-02-28 14:36:13 -08:00