Skip to content

[Engine] Flush heap file metadata page on each allocation#188

Merged
kTrzcinskii merged 4 commits intomainfrom
feat/heap-file-flush-metadata
Jan 12, 2026
Merged

[Engine] Flush heap file metadata page on each allocation#188
kTrzcinskii merged 4 commits intomainfrom
feat/heap-file-flush-metadata

Conversation

@kTrzcinskii
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kTrzcinskii kTrzcinskii merged commit 744c46a into main Jan 12, 2026
1 check passed
@kTrzcinskii kTrzcinskii deleted the feat/heap-file-flush-metadata branch January 12, 2026 23:40
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

Successfully merging this pull request may close these issues.

[ENGINE] Add background thread for flushing heap files metadata

3 participants