Skip to content

Commit

Permalink
Fix potential panic in repair
Browse files Browse the repository at this point in the history
The freed tree referenced by a savepoint should not be accessed, because its pages are not versioned -- they are immediately freed after a durable commit
  • Loading branch information
cberner committed Sep 4, 2024
1 parent 6319933 commit b07eca0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
12 changes: 0 additions & 12 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,18 +504,6 @@ impl Database {
if let Some(header) = savepoint.get_user_root() {
Self::check_pages_allocated_recursive(header.root, mem.clone())?;
}
if let Some(header) = savepoint.get_freed_root() {
let freed_pages_iter = AllPageNumbersBtreeIter::new(
header.root,
FreedTableKey::fixed_width(),
FreedPageList::fixed_width(),
mem.clone(),
)?;
for page_number in freed_pages_iter {
let page = page_number?;
assert!(mem.is_allocated(page));
}
}
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/tree_store/page_store/savepoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ impl Savepoint {
self.user_root
}

pub(crate) fn get_freed_root(&self) -> Option<BtreeHeader> {
self.freed_root
}

pub(crate) fn db_address(&self) -> *const TransactionTracker {
self.transaction_tracker.as_ref() as *const _
}
Expand Down

0 comments on commit b07eca0

Please sign in to comment.