-
Notifications
You must be signed in to change notification settings - Fork 11
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
shared log not flush to disk/ssd before return set result to client #472
Comments
In addition, fsync is a block io operation, which is unfriendly to rDSN, so should we consider "aio_fsync" and wrap it as a api of disk_aio? |
There is a currently a |
@imzhenyu, in |
Thanks, @shengofsun. There are two ways to ensure the data is really pushed to disk: |
@imzhenyu did you refer to the O_DIRECT? Behavior of O_DIRECT in Linux is not hardware/filesystem-independent, O_SYNC/O_DSYNC should be the proper choice for us. See this |
Seems O_DIRECT + O_SYNC is good enough. But unfortunately, the buffer should be the same as the situation under Windows that it needs to be aligned. For your questions:
|
O_SYNC is enough for hard sync, but as far as I can see, O_DIRECT is not necessary. And if we write file with a buffer of page size, the write amplification issue should reduce. Of course, this also need to test. |
so the resolution is to set O_SYNC flag when dsn_file_open() in log_file::create_write()? |
Let's try and see. |
in mutation_log_shared::append(), the shared log is not flushed (fsync on linux) before commit, which may cause data lost when machine restart under strong consistency semantics.
The text was updated successfully, but these errors were encountered: