diff --git a/include/rocksdb/file_system.h b/include/rocksdb/file_system.h index 6c4fee57482..c1d9b87add7 100644 --- a/include/rocksdb/file_system.h +++ b/include/rocksdb/file_system.h @@ -81,7 +81,14 @@ enum class IOType : uint8_t { // enum representing various operations supported by underlying FileSystem. // These need to be set in SupportedOps API for RocksDB to use them. -enum FSSupportedOps { kAsyncIO, kFSBuffer }; +enum FSSupportedOps { + kAsyncIO, // Supports async reads + kFSBuffer, // Supports handing off the file system allocated read buffer + // to the caller of Read/MultiRead + kVerifyAndReconstructRead, // Supports a higher level of data integrity. See + // the verify_and_reconstruct_read flag in + // IOOptions. +}; // Per-request options that can be passed down to the FileSystem // implementation. These are hints and are not necessarily guaranteed to be @@ -120,6 +127,18 @@ struct IOOptions { // directories and list only files in GetChildren API. bool do_not_recurse; + // Setting this flag indicates a corruption was detected by a previous read, + // so the caller wants to re-read the data with much stronger data integrity + // checking and correction, i.e requests the file system to reconstruct the + // data from redundant copies and verify checksums, if available, in order + // to have a better chance of success. It is expected that this will have a + // much higher overhead than a normal read. + // This is a hint. At a minimum, the file system should implement this flag in + // FSRandomAccessFile::Read and FSSequentialFile::Read + // NOTE: The file system must support kVerifyAndReconstructRead in + // FSSupportedOps, otherwise this feature will not be used. + bool verify_and_reconstruct_read; + // EXPERIMENTAL Env::IOActivity io_activity = Env::IOActivity::kUnknown;