rocksdb/db/db_impl
Yueh-Hsuan Chiang e267909ecf Enable a multi-level db to smoothly migrate to FIFO via DB::Open (#10348)
Summary:
FIFO compaction can theoretically open a DB with any compaction style.
However, the current code only allows FIFO compaction to open a DB with
a single level.

This PR relaxes the limitation of FIFO compaction and allows it to open a
DB with multiple levels.  Below is the read / write / compaction behavior:

* The read behavior is untouched, and it works like a regular rocksdb instance.
* The write behavior is untouched as well.  When a FIFO compacted DB
is opened with multiple levels, all new files will still be in level 0, and no files
will be moved to a different level.
* Compaction logic is extended.  It will first identify the bottom-most non-empty level.
Then, it will delete the oldest file in that level.

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

Test Plan:
Added a new test to verify the migration from level to FIFO where the db has multiple levels.
Extended existing test cases in db_test and db_basic_test to also verify
all entries of a key after reopening the DB with FIFO compaction.

Reviewed By: jay-zhuang

Differential Revision: D40233744

fbshipit-source-id: 6cc011d6c3467e6bfb9b6a4054b87619e69815e1
2022-10-18 14:38:13 -07:00
..
compacted_db_impl.cc Fix periodic_task unable to re-register the same task type (#10379) 2022-08-25 18:52:37 -07:00
compacted_db_impl.h Don't wait for indirect flush in read-only DB (#10569) 2022-08-29 13:36:23 -07:00
db_impl.cc Add option preserve_internal_time_seconds to preserve the time info (#10747) 2022-10-07 18:49:40 -07:00
db_impl.h Manual flush with wait=false should not stall when writes stopped (#10001) 2022-10-04 16:43:01 -07:00
db_impl_compaction_flush.cc Enable a multi-level db to smoothly migrate to FIFO via DB::Open (#10348) 2022-10-18 14:38:13 -07:00
db_impl_debug.cc Add manual_wal_flush, FlushWAL() to stress/crash test (#10698) 2022-09-30 15:48:33 -07:00
db_impl_experimental.cc Remove unused fields from FileMetaData (temporarily) (#10443) 2022-08-01 17:56:13 -07:00
db_impl_files.cc Add new property in IOOptions to skip recursing through directories and list only files during GetChildren. (#10668) 2022-10-03 10:59:45 -07:00
db_impl_open.cc Enable a multi-level db to smoothly migrate to FIFO via DB::Open (#10348) 2022-10-18 14:38:13 -07:00
db_impl_readonly.cc Skip swaths of range tombstone covered keys in merging iterator (2022 edition) (#10449) 2022-09-02 09:51:19 -07:00
db_impl_readonly.h Don't wait for indirect flush in read-only DB (#10569) 2022-08-29 13:36:23 -07:00
db_impl_secondary.cc Add new property in IOOptions to skip recursing through directories and list only files during GetChildren. (#10668) 2022-10-03 10:59:45 -07:00
db_impl_secondary.h Don't wait for indirect flush in read-only DB (#10569) 2022-08-29 13:36:23 -07:00
db_impl_write.cc fix issue 10751 (#10765) 2022-10-10 09:46:09 -07:00