-
Notifications
You must be signed in to change notification settings - Fork 409
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
Fix pageutils will truncate the file if write failed #4925
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-build-arm64 comment=true |
/run-all-tests |
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.
lgtm
/run-all-tests |
int truncate_res = 0; | ||
// If write failed in V3, Don't do truncate | ||
if (truncate_if_failed) | ||
{ | ||
// If error occurs, apply `ftruncate` try to truncate the broken bytes we have written. | ||
// Note that the result of this ftruncate is ignored, there is nothing we can do to | ||
// handle ftruncate error. The errno may change after ftruncate called. | ||
truncate_res = ::ftruncate(file->getFd(), offset); | ||
} |
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 introduce this ftruncate in #1934 for PageStorage V2 to handle error caused by incomplete write.
But for PageStorage V3, we perform random write in BlobFile, so we should not do ftruncate for V3
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 PR keeps the behavior not changed for V2, but disable the truncate after error happen for V3
Signed-off-by: JaySon-Huang <tshent@qq.com>
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.
LGTM
/merge |
@JaySon-Huang: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 254e351
|
/merge |
@JaySon-Huang: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: f7c8d8a
|
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
/merge |
@JaySon-Huang: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 4ed52a9
|
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
/run-integration-test |
@jiaqizho: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
What problem does this PR solve?
Issue Number: ref #3594
Problem Summary:
PageStorage
failed to write, Then PageUtils will truncate it into offset.random write
in V3 BlobFile.What is changed and how it works?
offset
.Check List
Tests
Side effects
Documentation
Release note