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: Avoid DB check inserts in cleanup-sequences (Backport #2328) #2331

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

timopollmeier
Copy link
Member

@timopollmeier timopollmeier commented Nov 29, 2024

What

When running gvmd with the --optimize=cleanup-sequences option, the
database checks during initialization will avoid most inserts.
Setting database_version and max_hosts in the meta table now uses
INSERT ... ON CONFLICT instead of deleting the previous entry.

Why

Skipping the inserts prevents the cleanup failing if one of the
sequence has already run out of ids.
The change to the meta table update reduces the risk of the meta table
id sequence running out.

References

Backport of #2328
GEA-576

When running gvmd with the --optimize=cleanup-sequences option, the
database checks during initialization will avoid most inserts.
Setting database_version and max_hosts in the meta table now uses
INSERT ... ON CONFLICT instead of deleting the previous entry.

Skipping the inserts prevents the cleanup failing if one of the
sequence has already run out of ids.
The change to the meta table update reduces the risk of the meta table
id sequence running out.

(cherry picked from commit 705c6c2)
The new parameter has been added to the check_db_port_lists prototype
and various check_db_... functions that would only return if
the avoid_db_check_inserts parameter is true have the parameter removed
and are instead wrapped in if conditions.

(cherry picked from commit 5c0d5fa)
@timopollmeier timopollmeier requested a review from a team as a code owner November 29, 2024 09:28
Copy link

Conventional Commits Report

Type Number
Bug Fixes 1

🚀 Conventional commits found.

@a-h-abdelsalam a-h-abdelsalam merged commit d5c9c6e into oldstable Nov 29, 2024
9 of 10 checks passed
@a-h-abdelsalam a-h-abdelsalam deleted the backport-pr-2328 branch November 29, 2024 09:36
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.

2 participants