-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Velox filesystem for SSD cache data file #11190
Conversation
This pull request was exported from Phabricator. Differential Revision: D64008883 |
✅ Deploy Preview for meta-velox canceled.
|
6c197bb
to
6091625
Compare
@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
6091625
to
6b290f6
Compare
@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zacw7 thanks for the change!
velox/common/file/File.cpp
Outdated
@@ -367,9 +367,12 @@ void LocalWriteFile::write( | |||
VELOX_CHECK_EQ( | |||
bytesWritten, | |||
length, | |||
"Failure in LocalWriteFile::write, {} vs {}", | |||
"Failure in LocalWriteFile::write, {} vs {}, error: {}, offset: {}, count: {}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/count/iovec count/
velox/common/file/File.cpp
Outdated
bytesWritten, | ||
length); | ||
length, | ||
strerror(errno), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use folly version of this? Check the other places.
velox/common/caching/SsdFile.h
Outdated
// WriteFile made from 'fd_'. | ||
std::unique_ptr<WriteFile> writeFile_; | ||
|
||
// WriteFile for logging evictions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/evictLogWriteFile_/evictLogFile_/
velox/common/caching/SsdFile.h
Outdated
std::unique_ptr<WriteFile> evictLogWriteFile_; | ||
|
||
// WriteFile for checkpoint. | ||
std::unique_ptr<WriteFile> checkpointWriteFile_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/checkpointWriteFile_/checkpointFile_
velox/common/caching/SsdFile.h
Outdated
|
||
// Synchronously logs that 'regions' are no longer valid in a possibly | ||
// existing checkpoint. | ||
void logEviction(const std::vector<int32_t>& regions); | ||
void logEviction(std::vector<int32_t>& regions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this? Thanks!
velox/common/caching/SsdFile.h
Outdated
@@ -489,7 +489,7 @@ class SsdFile { | |||
|
|||
// Returns true if checkpoint is needed. | |||
bool needCheckpoint(bool force) const { | |||
if (!checkpointEnabled()) { | |||
if (!checkpointEnabled() || checkpointWriteFile_ == nullptr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need this check? Thanks!
velox/common/caching/SsdFile.cpp
Outdated
evictLogFileOptions.shouldThrowOnFileAlreadyExists = false; | ||
try { | ||
evictLogWriteFile_ = fs_->openFileForWrite(logPath, evictLogFileOptions); | ||
} catch (std::exception& e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably can't leverage std::ofstream for this.
velox/common/caching/SsdFile.cpp
Outdated
@@ -1002,6 +977,9 @@ void SsdFile::readCheckpoint(std::ifstream& state) { | |||
idMap[id] = StringIdLease(fileIds(), id, name); | |||
} | |||
|
|||
const auto logPath = getEvictLogFilePath(); | |||
auto evictLogFd_ = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hasn't been replaced? Thanks!
07b5346
to
7e45725
Compare
7e45725
to
8939b42
Compare
@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
8939b42
to
a688ce0
Compare
ad95226
to
c239279
Compare
8ee8994
to
ffa39f0
Compare
@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zacw7 LGTM % minors. Thanks!
ffa39f0
to
76721ef
Compare
@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zacw7 LGTM. Thanks!
76721ef
to
21b8c81
Compare
@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
SSD cache currently uses native functions for file operations. This needs to be switched to Velox filesystem, so more advanced testing can be built by leveraging features like fault injections.
21b8c81
to
aa952de
Compare
@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
Summary:
SSD cache currently uses native functions for file operations. This needs to be switched to Velox filesystem, so more advanced testing can be built by leveraging features like fault injections.
Differential Revision: D64008883