Conversation
Contributor
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Contributor
There was a problem hiding this comment.
Code Review
This pull request enables the gc.vacuum_enabled setting by default. Feedback indicates that this change should be reverted because the current vacuum implementation contains a bug regarding SQL arguments and poses significant operational risks, such as blocking database access and potential disk space exhaustion.
| // GC defaults | ||
| v.SetDefault("gc.cron", "0 2 * * *") // Daily at 2:00 AM | ||
| v.SetDefault("gc.vacuum_enabled", false) | ||
| v.SetDefault("gc.vacuum_enabled", true) |
Contributor
There was a problem hiding this comment.
Enabling gc.vacuum_enabled by default is problematic for two reasons:
- Implementation Bug: The
runVacuumfunction ininternal/server/gc/gc.go(line 574) incorrectly passes extranilarguments to theVACUUMcommand:sqlDriver.ExecContext(ctx, vacuumSQL, nil, nil). SinceVACUUMdoes not accept parameters, this will cause the operation to fail with an error (e.g.,sql: expected 0 arguments, got 2) in most database drivers. - Operational Risk: For the default SQLite database,
VACUUMis a heavy, blocking operation that rebuilds the entire database file. It requires an exclusive lock and temporary disk space equal to the database size. Enabling this by default could lead to application hangs or disk space exhaustion for users with large databases.
This should remain false by default until the implementation is fixed and the operational impact is addressed.
Suggested change
| v.SetDefault("gc.vacuum_enabled", true) | |
| v.SetDefault("gc.vacuum_enabled", false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.