-
Notifications
You must be signed in to change notification settings - Fork 756
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
[store] fix: do not fsync sled data in unittets. File::sync_all() takes 10 ~ 30 ms, at worst 500 ms on a Mac #1231
Conversation
Thanks for the contribution! Please review the labels and make any necessary changes. |
2 similar comments
Thanks for the contribution! Please review the labels and make any necessary changes. |
Thanks for the contribution! Please review the labels and make any necessary changes. |
Codecov Report
@@ Coverage Diff @@
## master #1231 +/- ##
======================================
Coverage 72% 72%
======================================
Files 464 464
Lines 27465 27499 +34
======================================
+ Hits 19865 19901 +36
+ Misses 7600 7598 -2
Continue to review full report at Codecov.
|
@@ -51,6 +51,9 @@ pub struct StoreTestContext { | |||
pub fn new_test_context() -> StoreTestContext { | |||
let mut config = configs::Config::empty(); | |||
|
|||
// On mac File::sync_all() takes 10 ms ~ 30 ms, 500 ms at worst, which very likely to fail a test. |
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.
Can we check the OS if it's MACOS and set it?
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.
Can we check the OS if it's MACOS and set it?
Good idea 🤔
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.
All Non-Enterprise device which has no Enhanced Power Loss Data Protection cannot sync enough fast. I think it's not just MacOS issue
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.
@templexxx
You are totally right, as always! :DDD
Any suggestions for building a stable durable storage system would be appreciated!
…es 10 ~ 30 ms, at worst 500 ms on a Mac Sled tree wrappers provides an option to not to fsync after write operation. This should only be used in testing environment. For more details about the slow fsync issue: https://github.com/drmingdrmer/sledtest
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
CI Passed |
Thanks for the contribution! Please review the labels and make any necessary changes. |
I hereby agree to the terms of the CLA available at: https://datafuse.rs/policies/cla/
Summary
[store] fix: do not fsync sled data in unittets. File::sync_all() takes 10 ~ 30 ms, at worst 500 ms on a Mac
Sled tree wrappers provides an option to not to fsync after write
operation.
This should only be used in testing environment.
For more details about the slow fsync issue:
https://github.com/drmingdrmer/sledtest
Changelog
Related Issues
FuseStore v0.1 #271
[store] impl sled db backed raft-state-machine. #1080