rocksdb/env
Yanqin Jin 9358178edc Support for single-primary, multi-secondary instances (#4899)
Summary:
This PR allows RocksDB to run in single-primary, multi-secondary process mode.
The writer is a regular RocksDB (e.g. an `DBImpl`) instance playing the role of a primary.
Multiple `DBImplSecondary` processes (secondaries) share the same set of SST files, MANIFEST, WAL files with the primary. Secondaries tail the MANIFEST of the primary and apply updates to their own in-memory state of the file system, e.g. `VersionStorageInfo`.

This PR has several components:
1. (Originally in #4745). Add a `PathNotFound` subcode to `IOError` to denote the failure when a secondary tries to open a file which has been deleted by the primary.

2. (Similar to #4602). Add `FragmentBufferedReader` to handle partially-read, trailing record at the end of a log from where future read can continue.

3. (Originally in #4710 and #4820). Add implementation of the secondary, i.e. `DBImplSecondary`.
3.1 Tail the primary's MANIFEST during recovery.
3.2 Tail the primary's MANIFEST during normal processing by calling `ReadAndApply`.
3.3 Tailing WAL will be in a future PR.

4. Add an example in 'examples/multi_processes_example.cc' to demonstrate the usage of secondary RocksDB instance in a multi-process setting. Instructions to run the example can be found at the beginning of the source code.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4899

Differential Revision: D14510945

Pulled By: riversand963

fbshipit-source-id: 4ac1c5693e6012ad23f7b4b42d3c374fecbe8886
2019-03-26 16:45:31 -07:00
..
env_basic_test.cc Apply modernize-use-override (3) 2019-02-19 13:39:49 -08:00
env_chroot.cc Apply modernize-use-override (3) 2019-02-19 13:39:49 -08:00
env_chroot.h Change RocksDB License 2017-07-15 16:11:23 -07:00
env_encryption.cc Apply modernize-use-override (3) 2019-02-19 13:39:49 -08:00
env_hdfs.cc Support for single-primary, multi-secondary instances (#4899) 2019-03-26 16:45:31 -07:00
env_posix.cc Apply modernize-use-override (3) 2019-02-19 13:39:49 -08:00
env_test.cc Apply modernize-use-override (3) 2019-02-19 13:39:49 -08:00
env.cc Collect compaction stats by priority and dump to info LOG (#5050) 2019-03-19 17:28:19 -07:00
io_posix.cc remove incorrect assert in GetUniqueIdFromFile (#5102) 2019-03-25 23:28:29 -07:00
io_posix.h Support for single-primary, multi-secondary instances (#4899) 2019-03-26 16:45:31 -07:00
mock_env_test.cc Apply modernize-use-override (3) 2019-02-19 13:39:49 -08:00
mock_env.cc Apply modernize-use-override (3) 2019-02-19 13:39:49 -08:00
mock_env.h Update all unique/shared_ptr instances to be qualified with namespace std (#4638) 2018-11-09 11:19:58 -08:00
posix_logger.h Auto recovery from out of space errors (#4164) 2018-09-15 13:43:04 -07:00