-
Notifications
You must be signed in to change notification settings - Fork 17
Prevent data lost of unsynchronized files in case of power failure for unfinished blocks #909
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
Prevent data lost of unsynchronized files in case of power failure for unfinished blocks #909
Conversation
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## stable #909 +/- ##
==========================================
- Coverage 95.36% 95.34% -0.03%
==========================================
Files 167 167
Lines 10102 10159 +57
==========================================
+ Hits 9634 9686 +52
- Misses 468 473 +5
🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR implements file synchronization to prevent data loss during power failures for unfinished blocks. The solution adds periodic syncing functionality to the file cache to ensure data integrity.
- Adds a background sync worker that periodically syncs open write files every 100ms
- Implements sync-on-eviction for files being removed from the cache
- Extends the cache with iterator functionality to support the sync operations
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
reductstore/src/core/file_cache.rs | Main implementation of sync worker, file sync logic, and cache eviction handling |
reductstore/src/core/cache.rs | Adds iterator support for the sync worker to iterate over cached files |
CHANGELOG.md | Documents the bug fix for preventing data loss during power failures |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Closes #904
Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
Bug fix
What was changed?
The file cache is now responsible for synchronizing files with the disk to prevent data loss in the event of a power failure.
The File Cache synchronizes all files that are open for writing:
Related issues
Does this PR introduce a breaking change?
No
Other information: