Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to savepoint restoration #833

Merged
merged 4 commits into from
Jul 28, 2024
Merged

Fixes to savepoint restoration #833

merged 4 commits into from
Jul 28, 2024

Conversation

cberner
Copy link
Owner

@cberner cberner commented Jul 27, 2024

Fixes #832

This makes it more clear that the current freed tree is valid while it
is being traversed
Restoring a savepoint dropped processed transactions from the free tree.
However, this could lead to pages being leaked, if page A was allocated,
then added to the freed tree, then a savepoint was captured, and then
later A was freed a allocated again. When the savepoint was restored, A
would remain allocated but also be removed from the freed tree
This can't happen, since we only restore at the beginning of a clean
transaction
If the file had grown enough that the region tracker had to be
reallocated the restoration would free the tracker. This could lead to
corruption, if that page was allocated for other use, when the tracker
then got flushed to the same location

This would only occur in real world usage on very large database files, since the default region
tracker is sized for 4TiB
@cberner cberner merged commit e39e0f0 into master Jul 28, 2024
3 checks passed
@cberner cberner deleted the savepoints branch July 28, 2024 00:11
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.

Page leak in restore_savepoint()
1 participant