Skip to content
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

tolerate fallocate failure and print IO error in debug form #225

Merged
merged 6 commits into from
Jun 21, 2022

Conversation

tabokie
Copy link
Member

@tabokie tabokie commented Jun 21, 2022

fallocate is more performant but not supported on some platforms. This patch ignores its error.

Also fix the issue that std::io::Error doesn't print well for custom error kind.

Signed-off-by: tabokie [email protected]

@tabokie tabokie requested a review from Connor1996 June 21, 2022 03:30
Signed-off-by: tabokie <[email protected]>
@@ -152,18 +152,14 @@ impl LogFd {
});
#[cfg(target_os = "linux")]
{
fcntl::fallocate(
let _ = fcntl::fallocate(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not return

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not supported on some platforms. And we call it only for performance reason, skipping it is okay (e.g. already skipped on macos).

Signed-off-by: tabokie <[email protected]>
@tabokie tabokie changed the title tolerate fallocate failure and print IO error in debug form tolerate unsupported fallocate failure and print IO error in debug form Jun 21, 2022
@tabokie tabokie changed the title tolerate unsupported fallocate failure and print IO error in debug form tolerate fallocate failure and print IO error in debug form Jun 21, 2022
Signed-off-by: tabokie <[email protected]>
@tabokie tabokie requested a review from Connor1996 June 21, 2022 04:03
@codecov
Copy link

codecov bot commented Jun 21, 2022

Codecov Report

Merging #225 (0b9c404) into master (4e89901) will decrease coverage by 0.04%.
The diff coverage is 91.17%.

@@            Coverage Diff             @@
##           master     #225      +/-   ##
==========================================
- Coverage   97.16%   97.12%   -0.05%     
==========================================
  Files          29       29              
  Lines        9007     9030      +23     
==========================================
+ Hits         8752     8770      +18     
- Misses        255      260       +5     
Impacted Files Coverage Δ
src/errors.rs 100.00% <ø> (ø)
src/env/default.rs 92.00% <57.14%> (-1.83%) ⬇️
src/file_pipe_log/log_file.rs 99.28% <100.00%> (+0.01%) ⬆️
tests/failpoints/test_io_error.rs 100.00% <100.00%> (ø)
src/consistency.rs 91.11% <0.00%> (-2.23%) ⬇️
src/purge.rs 97.43% <0.00%> (-0.29%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e89901...0b9c404. Read the comment docs.

Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: tabokie <[email protected]>
@tabokie tabokie merged commit 5e8e4bb into tikv:master Jun 21, 2022
@tabokie tabokie deleted the fallocate branch June 21, 2022 05:04
tabokie added a commit to tabokie/raft-engine that referenced this pull request Jun 21, 2022
* tolerate fallocate failure and print IO error in debug form

Signed-off-by: tabokie <[email protected]>

* update CHANGELOG.md

Signed-off-by: tabokie <[email protected]>

* only tolerate e=95

Signed-off-by: tabokie <[email protected]>

* still tolerate unconditionally

Signed-off-by: tabokie <[email protected]>

* update doc

Signed-off-by: tabokie <[email protected]>

* add a failpoint test

Signed-off-by: tabokie <[email protected]>
tabokie added a commit that referenced this pull request Jun 22, 2022
)

* tolerate fallocate failure and print IO error in debug form

Signed-off-by: tabokie <[email protected]>

* update CHANGELOG.md

Signed-off-by: tabokie <[email protected]>

* only tolerate e=95

Signed-off-by: tabokie <[email protected]>

* still tolerate unconditionally

Signed-off-by: tabokie <[email protected]>

* update doc

Signed-off-by: tabokie <[email protected]>

* add a failpoint test

Signed-off-by: tabokie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants