rocksdb/file
Peter Dillinger 3ffb3baa0b Add (Live)FileStorageInfo API (#8968)
Summary:
New classes FileStorageInfo and LiveFileStorageInfo and
'experimental' function DB::GetLiveFilesStorageInfo, which is intended
to largely replace several fragmented DB functions needed to create
checkpoints and backups.

This function is now used to create checkpoints and backups, because
it fixes many (probably not all) of the prior complexities of checkpoint
not having atomic access to DB metadata. This also ensures strong
functional test coverage of the new API. Specifically, much of the old
CheckpointImpl::CreateCustomCheckpoint has been migrated to and
updated in DBImpl::GetLiveFilesStorageInfo, with the former now
calling the latter.

Also, the class FileStorageInfo in metadata.h compatibly replaces
BackupFileInfo and serves as a new base class for SstFileMetaData.
Some old fields of SstFileMetaData are still provided (for now) but
deprecated.

Although FileStorageInfo::directory is accurate when using db_paths
and/or cf_paths, these have never been supported by Checkpoint
nor BackupEngine and still are not. This change does now detect
these cases and return NotSupported when appropriate. (More work
needed for support.)

Somehow this change broke ProgressCallbackDuringBackup, but
the progress_callback logic was dubious to begin with because it
would call the callback based on copy buffer size, not size actually
copied. Logic and test updated to track size actually copied
per-thread.

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

Test Plan:
tests updated.
DB::GetLiveFilesStorageInfo mostly tested by use in CheckpointImpl.
DBTest.SnapshotFiles updated to also test GetLiveFilesStorageInfo,
including reading the data after DB close.
Added CheckpointTest.CheckpointWithDbPath (NotSupported).

Reviewed By: siying

Differential Revision: D31242045

Pulled By: pdillinger

fbshipit-source-id: b183d1ce9799e220daaefd6b3b5365d98de676c0
2021-10-16 10:04:32 -07:00
..
delete_scheduler_test.cc Use SST file manager to track blob files as well (#8037) 2021-03-17 20:44:49 -07:00
delete_scheduler.cc Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
delete_scheduler.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
file_prefetch_buffer.cc Improve BlockPrefetcher to prefetch only for sequential scans (#7394) 2021-04-28 12:53:46 -07:00
file_prefetch_buffer.h Improve BlockPrefetcher to prefetch only for sequential scans (#7394) 2021-04-28 12:53:46 -07:00
file_util.cc Allow WAL dir to change with db dir (#8582) 2021-07-30 12:16:44 -07:00
file_util.h Allow WAL dir to change with db dir (#8582) 2021-07-30 12:16:44 -07:00
filename.cc Add (Live)FileStorageInfo API (#8968) 2021-10-16 10:04:32 -07:00
filename.h Add (Live)FileStorageInfo API (#8968) 2021-10-16 10:04:32 -07:00
line_file_reader.cc Replace Status with IOStatus in the backupable_db (#8820) 2021-09-15 15:09:48 -07:00
line_file_reader.h Replace Status with IOStatus in the backupable_db (#8820) 2021-09-15 15:09:48 -07:00
prefetch_test.cc Change the File System File Wrappers to std::unique_ptr (#8618) 2021-09-13 08:46:19 -07:00
random_access_file_reader_test.cc use the pointer directly (#8095) 2021-03-26 21:31:16 -07:00
random_access_file_reader.cc Add file temperature related counter and bytes stats to and io_stats (#8710) 2021-10-07 14:58:41 -07:00
random_access_file_reader.h Add file temperature related counter and bytes stats to and io_stats (#8710) 2021-10-07 14:58:41 -07:00
read_write_util.cc Move old files to warm tier in FIFO compactions (#8310) 2021-08-09 12:51:14 -07:00
read_write_util.h Refactor: add LineFileReader and Status::MustCheck (#8026) 2021-03-09 20:12:38 -08:00
readahead_raf.cc Make StringEnv, StringSink, StringSource use FS classes (#7786) 2021-01-04 16:01:01 -08:00
readahead_raf.h Make StringEnv, StringSink, StringSource use FS classes (#7786) 2021-01-04 16:01:01 -08:00
sequence_file_reader.cc Add file operation callbacks to SequentialFileReader (#8982) 2021-10-05 10:51:59 -07:00
sequence_file_reader.h Add file operation callbacks to SequentialFileReader (#8982) 2021-10-05 10:51:59 -07:00
sst_file_manager_impl.cc Cleanup includes in dbformat.h (#8930) 2021-09-29 04:04:40 -07:00
sst_file_manager_impl.h Use SST file manager to track blob files as well (#8037) 2021-03-17 20:44:49 -07:00
writable_file_writer.cc Introduce a mechanism to dump out blocks from block cache and re-insert to secondary cache (#8912) 2021-10-07 11:42:31 -07:00
writable_file_writer.h Introduce a mechanism to dump out blocks from block cache and re-insert to secondary cache (#8912) 2021-10-07 11:42:31 -07:00