[db] Add fsync support #1915 - #1916
Merged
Merged
Conversation
Closed
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces explicit durability controls for the agdb storage layer by adding a SyncMode API and exposing synchronization controls on Db, enabling safer operation on filesystems where write ordering/flush behavior can break WAL expectations (e.g., some network filesystems).
Changes:
- Add
SyncMode(defaultNone, optionalCommit) and plumb it throughStorageData,Storage, andDb(set_sync_mode,sync_mode,sync). - Implement commit-time syncing behavior for file-backed storage and add WAL sync support.
- Add documentation and a regression test covering the new
DbFilesync API surface.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| agdb/tests/db_test.rs | Adds a test exercising DbFile::{sync,set_sync_mode,sync_mode}. |
| agdb/src/storage/write_ahead_log.rs | Adds WriteAheadLog::sync() to fdatasync the WAL file. |
| agdb/src/storage/file_storage.rs | Introduces sync_mode handling in flush(), adds sync(), and updates WAL-apply behavior. |
| agdb/src/storage/file_storage_memory_mapped.rs | Delegates new sync-related StorageData methods to the underlying FileStorage. |
| agdb/src/storage/any_storage.rs | Plumbs new sync-related StorageData methods through the AnyStorage enum. |
| agdb/src/storage.rs | Defines SyncMode and extends StorageData/Storage with sync-related APIs. |
| agdb/src/lib.rs | Re-exports SyncMode from the crate root. |
| agdb/src/db.rs | Exposes DbImpl::{sync,set_sync_mode,sync_mode} public API. |
| agdb_web/content/docs/01.guides/01.concepts.md | Documents SyncMode and when to enable commit syncing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
michaelvlach
enabled auto-merge (squash)
August 18, 2026 09:50
…into 1915-db-add-fsync-support
agnesoft
approved these changes
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.