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

Fix size calculation in --optimize vacuum #1447

Merged
merged 3 commits into from
Mar 17, 2021

Conversation

timopollmeier
Copy link
Member

@timopollmeier timopollmeier commented Mar 16, 2021

What:
The database size was still trying to stat a filesystem path as used
by SQLite as the database name.
This is changed to use the SQL function pg_database_size instead and
also the case where the size increases is now handled.

Why:
This fixes the warnings about the failed stats reported in #1432.

How did you test it:
By running gvmd --optimize vacuum after importing and deleting several reports.

Checklist:

The database size was still trying to stat a filesystem path as used
by SQLite as the database name.
This is changed to use the SQL function pg_database_size instead and
also the case where the size increases is now handled.
@timopollmeier timopollmeier added backport-to-stable This pull request will be backported to the stable branch backport-to-main This pull request will be ported to the master branch labels Mar 16, 2021
In the "vacuum" case, old_size and new_size no longer need to be
initialized with 0.
@timopollmeier timopollmeier marked this pull request as ready for review March 16, 2021 09:43
@timopollmeier timopollmeier requested a review from a team as a code owner March 16, 2021 09:43
@nichtsfrei nichtsfrei merged commit 36e6700 into greenbone:gvmd-20.08 Mar 17, 2021
timopollmeier added a commit that referenced this pull request Mar 17, 2021
Fix size calculation in `--optimize vacuum` (bp #1447)
timopollmeier added a commit that referenced this pull request Mar 17, 2021
Fix size calculation in `--optimize vacuum` (bp #1447)
@timopollmeier timopollmeier deleted the fix-vacuum-size-check branch October 15, 2021 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-main This pull request will be ported to the master branch backport-to-stable This pull request will be backported to the stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants