-
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
feat: Use Velox fs for ssd cache checkpoint file #11783
Conversation
This pull request was exported from Phabricator. Differential Revision: D66892136 |
✅ Deploy Preview for meta-velox canceled.
|
8a169ff
to
ddda3ab
Compare
…1783) Summary: Switch the ssd cache checkpoint file to use Velox filesystem for file r/w operations, so that more advanced testing can be built by leveraging features like fault injections. Differential Revision: D66892136
This pull request was exported from Phabricator. Differential Revision: D66892136 |
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 change % comments
@@ -383,6 +383,8 @@ void LocalWriteFile::truncate(int64_t newSize) { | |||
0, | |||
"ftruncate failed in LocalWriteFile::truncate: {}.", | |||
folly::errnoStr(errno)); | |||
// Reposition the file offset to the end of the file for append(). |
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? thanks!
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.
Underline LocalWriteFile->append, it's ::write:
velox/velox/common/file/File.cpp
Line 323 in ddda3ab
const uint64_t bytesWritten = ::write(fd_, data.data(), data.size()); |
The writing takes place at an inexplicit offset (https://man7.org/linux/man-pages/man2/write.2.html), which won't be reset automatically after truncate.
velox/common/caching/SsdFile.cpp
Outdated
state.write(checkpointVersion().data(), sizeof(int32_t)); | ||
state.write(asChar(&maxRegions_), sizeof(maxRegions_)); | ||
state.write(asChar(&numRegions_), sizeof(numRegions_)); | ||
checkpointWriteFile_->append(checkpointVersion()); |
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.
You can allocate 1MB buffer from cache pool for checkpointing buffer.
velox/common/caching/SsdFile.cpp
Outdated
} | ||
} | ||
checkpointWriteFile_->append(folly::IOBuf::copyBuffer( |
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 just need to sync data file right before write out kCheckpointEndMarker?
…1783) Summary: Switch the ssd cache checkpoint file to use Velox filesystem for file r/w operations, so that more advanced testing can be built by leveraging features like fault injections. Differential Revision: D66892136
ddda3ab
to
01a2da0
Compare
This pull request was exported from Phabricator. Differential Revision: D66892136 |
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 overall looks good % minors.
01a2da0
to
9afe3ad
Compare
…1783) Summary: Switch the ssd cache checkpoint file to use Velox filesystem for file r/w operations, so that more advanced testing can be built by leveraging features like fault injections. Differential Revision: D66892136
This pull request was exported from Phabricator. Differential Revision: D66892136 |
…1783) Summary: Switch the ssd cache checkpoint file to use Velox filesystem for file r/w operations, so that more advanced testing can be built by leveraging features like fault injections. Differential Revision: D66892136
9afe3ad
to
72262ca
Compare
This pull request was exported from Phabricator. Differential Revision: D66892136 |
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 update!
velox/common/caching/SsdFile.cpp
Outdated
} | ||
|
||
std::string readString(common::FileInputStream* stream, int32_t length) { | ||
std::string data; |
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.
std::string data(length);
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 requires a second arg. I'll put it as std::string data(length, '\0')
…1783) Summary: Switch the ssd cache checkpoint file to use Velox filesystem for file r/w operations, so that more advanced testing can be built by leveraging features like fault injections. Differential Revision: D66892136
72262ca
to
dcc1f05
Compare
This pull request was exported from Phabricator. Differential Revision: D66892136 |
…1783) Summary: Switch the ssd cache checkpoint file to use Velox filesystem for file r/w operations, so that more advanced testing can be built by leveraging features like fault injections. Differential Revision: D66892136
dcc1f05
to
bb61e4e
Compare
This pull request was exported from Phabricator. Differential Revision: D66892136 |
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!
…1783) Summary: Switch the ssd cache checkpoint file to use Velox filesystem for file r/w operations, so that more advanced testing can be built by leveraging features like fault injections. Differential Revision: D66892136
bb61e4e
to
8268555
Compare
This pull request was exported from Phabricator. Differential Revision: D66892136 |
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 update!
…1783) Summary: Switch the ssd cache checkpoint file to use Velox filesystem for file r/w operations, so that more advanced testing can be built by leveraging features like fault injections. Reviewed By: xiaoxmeng Differential Revision: D66892136
8268555
to
fd46b9b
Compare
This pull request was exported from Phabricator. Differential Revision: D66892136 |
This pull request has been merged in ac13440. |
…1783) Summary: Pull Request resolved: facebookincubator#11783 Switch the ssd cache checkpoint file to use Velox filesystem for file r/w operations, so that more advanced testing can be built by leveraging features like fault injections. Reviewed By: xiaoxmeng Differential Revision: D66892136 fbshipit-source-id: d4da2df1f5da976b0a71c4a1a087a2c0ba569328
Summary: Switch the ssd cache checkpoint file to use Velox filesystem for file r/w operations, so that more advanced testing can be built by leveraging features like fault injections.
Differential Revision: D66892136