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

Support asynchronously incrementally sync files to disk while they are being written #348

Open
overvenus opened this issue Jan 3, 2024 · 4 comments

Comments

@overvenus
Copy link
Member

overvenus commented Jan 3, 2024

The idea is borrowed from RocksDB bytes_per_sync. It uses sync_file_range1 that allows asynchronously incrementally sync files to disk while they are being written.
It smoothes out write I/Os over time and reduce fdatasync latency spike as we saw in #346 (comment) .

Note: The feature proposed here is different from the deprecated bytes_per_sync feature which sync file synchronously.

Footnotes

  1. https://man7.org/linux/man-pages/man2/sync_file_range.2.html

@v0y4g3r
Copy link

v0y4g3r commented Jan 10, 2024

A similar issue: GreptimeTeam/greptimedb#3085
Currently we use periodical fsync to alleviate the problem.

Before the periodical fsync the disk ioutil looks like:
image

@LykxSassinator
Copy link
Contributor

THx for your advices. This problems might not be similar to yours. And we've met this problem on Cloud Env when rewriting and fixed it in #347, by introducing bytes_per_sync to limit the maximum flushing bytes. /cc @v0y4g3r

FYI, u can check whether there exists similar syncing problems when rewriting raft logs. And if does, u can check the latest version as your choice.

@v0y4g3r
Copy link

v0y4g3r commented Apr 16, 2024

THx for your advices. This problems might not be similar to yours. And we've met this problem on Cloud Env when rewriting and fixed it in #347, by introducing bytes_per_sync to limit the maximum flushing bytes. /cc @v0y4g3r

FYI, u can check whether there exists similar syncing problems when rewriting raft logs. And if does, u can check the latest version as your choice.

Do you have any plan to release a new version?

@LykxSassinator
Copy link
Contributor

LykxSassinator commented Apr 16, 2024

/cc @overvenus @tabokie PTAL, thx.

We'll do it recently. Before that, u can update your dependency of raft-engine with the latest commit-id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants