Support remote file system for blob direct write file#14585
Support remote file system for blob direct write file#14585xingbowang wants to merge 7 commits intofacebook:mainfrom
Conversation
|
| Check | Count |
|---|---|
cppcoreguidelines-special-member-functions |
1 |
performance-no-automatic-move |
1 |
performance-unnecessary-copy-initialization |
1 |
| Total | 3 |
Details
db/blob/blob_file_reader.cc (1 warning(s))
db/blob/blob_file_reader.cc:143:12: warning: constness of 'open_file_size_status' prevents automatic move [performance-no-automatic-move]
db/blob/db_blob_direct_write_test.cc (2 warning(s))
db/blob/db_blob_direct_write_test.cc:121:7: warning: class 'ActiveBlobVisibilityWritableFile' defines a non-default destructor but does not define a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]
db/blob/db_blob_direct_write_test.cc:208:23: warning: local copy 'tracked_path' of the variable 'fname' is never modified; consider avoiding the copy [performance-unnecessary-copy-initialization]
11d44b5 to
976a7cd
Compare
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit de72196 Code Review: Support remote file system for blob direct write filePR: Support remote file system for blob direct write file SummaryThis PR adds remote filesystem support for blob direct write files by preferring FindingsHIGH: Inconsistency with table/format.cc fallback behaviorFile:
Recommendation: Align with MEDIUM:
|
|
@xingbowang has imported this pull request. If you are a Meta employee, you can view this in D100002686. |
|
@xingbowang has imported this pull request. If you are a Meta employee, you can view this in D100002686. |
|
@xingbowang has imported this pull request. If you are a Meta employee, you can view this in D100002686. |
# Conflicts: # db/blob/db_blob_direct_write_test.cc
|
@xingbowang has imported this pull request. If you are a Meta employee, you can view this in D100002686. |
Summary
This PR adds remote file system support for blob direct write files.
Remote file systems (e.g. distributed storage) may report a stale path-level file size for an actively-written blob file while the opened read handle can see the latest bytes. This mismatch caused reads to fail with a "Malformed blob file" corruption error.
Changes
New:
blob_file_open_options.hIntroduces a file-open contract via
FileOptions::io_options.property_bag:SetBlobFileActiveDirectWriteOpenMode()— marks file options to signal this is an active direct-write blob fileIsBlobFileActiveDirectWriteOpenMode()— lets aFileSystemimplementation detect the hint and adjust behavior (e.g., use an open-handle view for size queries)blob_file_reader.ccFSRandomAccessFile::GetFileSize()on the open handle in addition to the path-levelfs->GetFileSize()blob_file_cache.ccopen_file_optionswith the active-direct-write hint set whenallow_footer_skip_retryis true (i.e., the file is still being written)blob_file_partition_manager.ccFileOptionsused to open new blob files for writingTests
BlobFileReaderTest.CreateReaderUsesOpenedFileSizeWhenPathSizeIsStale— unit test with aStalePathSizeFileSystemwrapper that returns size 0 at the path level but the real file is readable via the open handleDBBlobDirectWriteTest.DirectWriteUsesActiveFileOpenHintForRemoteFile— integration test with aRemoteBlobVisibilityFileSystemthat verifies the active-hint flag is set on both writer and reader open calls, and that reads succeed during active direct writes