Skip to content

Fix job deletion notification and add vacuum#717

Merged
gabriel-samfira merged 2 commits intocloudbase:mainfrom
gabriel-samfira:small-fixes
Apr 13, 2026
Merged

Fix job deletion notification and add vacuum#717
gabriel-samfira merged 2 commits intocloudbase:mainfrom
gabriel-samfira:small-fixes

Conversation

@gabriel-samfira
Copy link
Copy Markdown
Member

When DeleteInactionableJobs runs, we need to first fetch jobs that match then remove them. This is done to get the IDs of the jobs we are removing so that we can send a notification of the action. Otherwise, database watchers are never notified.

This change also adds a vacuum routine to free up space taken by the sqlite database.

When DeleteInactionableJobs runs, we need to first fetch jobs that match
then remove them. This is done to get the IDs of the jobs we are removing
so that we can send a notification of the action. Otherwise, database
watchers are never notified.

This change also adds a vacuum routine to free up space taken by the sqlite
database.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
We don't want to recreate the entire DB on every vacuum, as that would
potentially be expensive (depending on DB size) and would block writes
while vacuum runs. Switching to incremental_vacuum allows us to only
free up pages that have been marked as free.

This adds some overhead as sqlite needs to keep track of freed pages,
but it's better than potentially using up a lot of disk space while
vacuum runs and blocking writes for a long time.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
@gabriel-samfira gabriel-samfira merged commit 41f408e into cloudbase:main Apr 13, 2026
4 checks passed
@gabriel-samfira gabriel-samfira deleted the small-fixes branch April 13, 2026 14:45
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