Skip to content

datastore: create enrichment update_operation in txn - #2076

Open
bradr5 wants to merge 3 commits into
quay:mainfrom
bradr5:fix-enrichment-update-operation-txn
Open

bradr5 wants to merge 3 commits into
quay:mainfrom
bradr5:fix-enrichment-update-operation-txn

Conversation

@bradr5

@bradr5 bradr5 commented Nov 3, 2026

Copy link
Copy Markdown

Same fix as #1303, applied to enrichments.

The enrichment update_operation row was created and committed before the transaction that inserts its enrichment records. If another matcher refreshed latest_update_operations during that window, it selected the new update_operation before any of its records were committed, and GetEnrichment returned nothing (e.g. empty NVD scores) until the load finished.

If the load failed or was interrupted, the empty update_operation stayed behind and kept enrichments empty until the next successful update.

This moves the update_operation insert into the same transaction as the enrichment inserts, so a refresh can only see it after its records commit, and a failed load leaves nothing behind.

Same fix as quay#1303, applied to enrichments.

The enrichment update_operation row was created and committed before the
transaction that inserts its enrichment records. If another matcher
refreshed latest_update_operations during that window, it selected the new
update_operation before any of its records were committed, and
GetEnrichment returned nothing until the load finished. If the load failed
or was interrupted, the empty update_operation stayed behind and kept
enrichments empty until the next successful update.

Create the update_operation in the same transaction as the enrichment
inserts, so a refresh can only see it after its records commit, and a
failed load leaves nothing behind.

Signed-off-by: bradr5 <braroger@redhat.com>
@bradr5
bradr5 requested review from a team as code owners November 3, 2026 16:26
@bradr5
bradr5 requested a review from hdonnay November 3, 2026 16:27
@vjwilson
vjwilson requested a review from crozzy November 9, 2026 19:06

@crozzy crozzy 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.

LGTM, thanks!

@crozzy

crozzy commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

could you rebase @bradr5 ?

bradr5 and others added 2 commits November 11, 2026 14:40

This branch has not been deployed

No deployments
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.

2 participants