Skip to content

opt: enable vacuum by default, close #1492#1500

Merged
looplj merged 1 commit into
unstablefrom
dev-tmp
Apr 26, 2026
Merged

opt: enable vacuum by default, close #1492#1500
looplj merged 1 commit into
unstablefrom
dev-tmp

Conversation

@looplj

@looplj looplj commented Apr 26, 2026

Copy link
Copy Markdown
Owner

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread conf/conf.go
// 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Enabling gc.vacuum_enabled by default is problematic for two reasons:

  1. Implementation Bug: The runVacuum function in internal/server/gc/gc.go (line 574) incorrectly passes extra nil arguments to the VACUUM command: sqlDriver.ExecContext(ctx, vacuumSQL, nil, nil). Since VACUUM does 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.
  2. Operational Risk: For the default SQLite database, VACUUM is 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)

@looplj looplj merged commit 4c9799a into unstable Apr 26, 2026
5 checks passed
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