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

GC: Do query execution all in one rather than separate #517

Merged
merged 1 commit into from
Dec 13, 2021

Conversation

crozzy
Copy link
Contributor

@crozzy crozzy commented Nov 12, 2021

This change will delete the orphaned vulns, ie. those
that are no longer tied up the update_operations, in
one query rather than 3 seperate ones.

Signed-off-by: crozzy joseph.crosland@gmail.com

@crozzy crozzy force-pushed the crozzy-updates-to-gc-query branch 3 times, most recently from a6b7cff to 0b24155 Compare November 18, 2021 19:00
@crozzy crozzy marked this pull request as ready for review November 18, 2021 19:51
@crozzy crozzy requested a review from a team as a code owner November 18, 2021 19:51
@crozzy crozzy requested review from hdonnay, kwestpharedhat and a team and removed request for a team November 18, 2021 19:51
Copy link
Member

@hdonnay hdonnay left a comment

Choose a reason for hiding this comment

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

This approach looks much simpler and hopefully faster. Some q's around the error handling, though.

internal/vulnstore/postgres/gc.go Outdated Show resolved Hide resolved
internal/vulnstore/postgres/gc.go Outdated Show resolved Hide resolved
internal/vulnstore/postgres/gc.go Outdated Show resolved Hide resolved
@crozzy
Copy link
Contributor Author

crozzy commented Nov 18, 2021

11:21PM DBG lock failed error="ctxlock: lock acquisition failed" component=libvuln/updates/Manager.Run key=garbage-collection
11:21PM DBG lock context canceled, garbage collection already running error="context canceled" component=libvuln/updates/Manager.Run

GC lock working with multiple matchers running

hdonnay
hdonnay previously approved these changes Dec 7, 2021
Copy link
Member

@hdonnay hdonnay left a comment

Choose a reason for hiding this comment

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

SGTM

This change will delete the orphaned vulns, ie. those
that are no longer tied up the update_operations, in
one query rather than 3 seperate ones.

Signed-off-by: crozzy <joseph.crosland@gmail.com>
@crozzy crozzy merged commit 1123788 into quay:main Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants