Skip to content

Commit

Permalink
Revert "Remove attempted free uncommited in restore_savepoint"
Browse files Browse the repository at this point in the history
This reverts commit a41f3ff.

Actually this optimization is useful because we allow restoring into
dirty transcations. The original commit message was wrong about that
  • Loading branch information
cberner committed Jul 28, 2024
1 parent 4f05d1f commit 274d620
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,11 @@ impl WriteTransaction {
if whitelist.contains(&page) {
continue;
}
freed_pages.push(page);
if self.mem.uncommitted(page) {
self.mem.free(page);
} else {
freed_pages.push(page);
}
}
*self.freed_pages.lock().unwrap() = freed_pages;
self.tables.lock().unwrap().table_tree = TableTreeMut::new(
Expand Down Expand Up @@ -777,8 +781,12 @@ impl WriteTransaction {
&& !freed_pages_hash.contains(&page)
&& !whitelist.contains(&page)
{
freed_pages.push(page);
freed_pages_hash.insert(page);
if self.mem.uncommitted(page) {
self.mem.free(page);
} else {
freed_pages.push(page);
freed_pages_hash.insert(page);
}
}
}
}
Expand Down

0 comments on commit 274d620

Please sign in to comment.