Skip to content

Conversation

@Polyphemus980
Copy link
Contributor

No description provided.

@Polyphemus980 Polyphemus980 linked an issue Jan 2, 2026 that may be closed by this pull request
Copy link
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 refactors B-Tree multi-page operations to write all modified pages atomically to the Write-Ahead Log (WAL) instead of dropping them individually. The key change is collecting all PinnedWritePage instances during split and merge operations in a dropped_page_latches vector, then calling cache.drop_write_pages() once at the end to flush them as a single MultiPageOperation.

Key Changes

  • Added dropped_page_latches parameter threading through B-Tree split and merge operations
  • Modified all leaf and internal node split/merge/redistribution functions to collect modified pages
  • Changed WAL write pattern from individual page drops to batched atomic writes via drop_write_pages()

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
storage/src/cache.rs Fixed duplicate comment marker in documentation for drop_write_pages()
engine/src/b_tree.rs Added dropped_page_latches vector to collect modified pages during splits and merges; threaded this parameter through all affected functions; added drop_write_pages() calls at operation completion points

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Polyphemus980 Polyphemus980 force-pushed the feat/multi-lock-drop-b-tree branch from 5189a77 to 0e0c00a Compare January 2, 2026 16:01
@Polyphemus980 Polyphemus980 merged commit 9cbdf17 into main Jan 2, 2026
1 check passed
@Polyphemus980 Polyphemus980 deleted the feat/multi-lock-drop-b-tree branch January 2, 2026 18:19
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] BTree - change api to send requests to WAL

3 participants