-
Notifications
You must be signed in to change notification settings - Fork 0
[STORAGE] Send diffs from PinnedWritePage to Wal
#173
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
Conversation
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 automatic and manual WAL (Write-Ahead Log) logging for page modifications in the storage cache. When a PinnedWritePage is dropped, its diffs are automatically sent to the WAL as a single-page operation. Alternatively, multiple pages can be manually dropped together using Cache::drop_write_pages() to create an atomic multi-page WAL operation.
Key changes:
- Added automatic WAL logging on
PinnedWritePagedrop for pages with modifications - Implemented
Cache::drop_write_pages()method to batch multiple page updates into a single atomic WAL operation - Changed
wal_clientinCachefromOption<WalClient>toOption<Arc<WalClient>>to enable sharing acrossPinnedWritePageinstances
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| storage/src/page_diff.rs | Added empty() method to check if a PageDiff has any diffs (used to avoid logging empty changes) |
| storage/src/cache.rs | Added wal field to PinnedWritePage, implemented automatic WAL logging in Drop, added drop_write_pages() method for batching, changed wal_client to use Arc, and added comprehensive tests for all WAL logging scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Updated cache to allow dropping multiple pages as one
MultiPageOperationto wal.If
PinnedWritePagehas diffs during its drop then they are sent asSinglePageOperationto wal.