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

Add sync_dir interface to Env #2884

Merged
merged 1 commit into from
Feb 12, 2020
Merged

Conversation

lingbin
Copy link
Contributor

@lingbin lingbin commented Feb 12, 2020

when we need to ensure that a newly-created file is fully
synchronized back to disk, we should call fsync() on the parent
directory—that is, the directory containing the newly-created file.
That is to say, In this situation, we should call fsync() on
both the newly-created file and its parent directory.

Unfortunately, currently in Doris, in any scenario, directories
are not fsynced.

This patch adds sync_dir() interface first, laying the goundwork
for future fixes.

This patch also remove unneeded private method dir_exists().

when we need to ensure that **a newly-created file** is fully
synchronized back to disk, we should call `fsync()` on the parent
directory—that is, the directory containing the newly-created file.
That is to say, In this situation, we should call `fsync()` on
both the newly-created file and its parent directory.

Unfortunately, currently in Doris, in any scenario, directories
are not fsynced.

This patch adds `sync_dir()` interface first, laying the goundwork
for future fixes.

This patch also remove unneeded private method `dir_exists()`.
@lingbin lingbin self-assigned this Feb 12, 2020
@lingbin lingbin added kind/improvement area/storage Issues or PRs related to storage engine labels Feb 12, 2020
@lingbin lingbin added this to the 0.13.0 milestone Feb 12, 2020
@lingbin lingbin merged commit e9ff40f into apache:master Feb 12, 2020
@lingbin lingbin deleted the add-sync-dir-to-env branch February 12, 2020 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage Issues or PRs related to storage engine kind/improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants