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

Allow vacuum on main #734

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

marco6
Copy link
Collaborator

@marco6 marco6 commented Feb 19, 2025

As discussed in these days on MM, VACUUM seems to be a transactional operation.

While it is true that it needs to attach a temporary database, new pages are then copied in the WAL and, as such, the attachment of the temporary file does not violate the VFS assumption about WAL and main file being unique after every statement.

This PR changes the implementation from one that allows 0 attached database (through sqlite3_limit) to one using an authorizer to allow only temporary files to be attached.

@marco6 marco6 requested a review from just-now February 19, 2025 14:01
Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 91.93548% with 5 lines in your changes missing coverage. Please review.

Project coverage is 81.14%. Comparing base (3b87142) to head (75a1b84).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/db.c 66.66% 1 Missing and 2 partials ⚠️
src/leader.c 88.88% 0 Missing and 1 partial ⚠️
src/vfs.c 93.75% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #734      +/-   ##
==========================================
+ Coverage   74.02%   81.14%   +7.11%     
==========================================
  Files         192      196       +4     
  Lines       27899    29648    +1749     
  Branches     2802     4100    +1298     
==========================================
+ Hits        20653    24057    +3404     
+ Misses       4914     3916     -998     
+ Partials     2332     1675     -657     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

The amalgamation does not support LIMIT on delete.
@marco6
Copy link
Collaborator Author

marco6 commented Feb 19, 2025

While I don't like a lot the implementation (the parsing of vacuum) this would fix #530.

@marco6 marco6 force-pushed the allow-vacuum-on-main branch from 3501316 to d9ee242 Compare February 19, 2025 16:49
@marco6
Copy link
Collaborator Author

marco6 commented Feb 19, 2025

The implementation seems now better after the call with @just-now. I'm marking this as ready.

@marco6 marco6 marked this pull request as ready for review February 19, 2025 16:54
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.

1 participant