[Engine] Flush heap file metadata page on each allocation#188
[Engine] Flush heap file metadata page on each allocation#188kTrzcinskii merged 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes the heap file metadata persistence strategy from lazy (flush on demand or on Drop) to eager (flush immediately after each page allocation). The change removes the dirty-tracking mechanism using AtomicBool and simplifies the metadata structure by wrapping the entire Metadata struct in a single Mutex rather than having individual Mutex-wrapped fields.
Changes:
- Metadata is now flushed to disk immediately after every record or overflow page allocation
- Simplified locking by wrapping entire Metadata struct in Mutex instead of individual fields
- Removed Drop implementation that previously handled deferred metadata flushing
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| engine/src/heap_file/pages.rs | Simplified Metadata struct by removing Mutex and AtomicBool from individual fields, updated conversion implementations |
| engine/src/heap_file/mod.rs | Changed metadata to be wrapped in single Mutex, added PageTypeForMetadata enum, modified allocate_page_with_metadata to flush immediately, removed Drop implementation, updated all metadata access callsites and tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.