Skip to content

datastore: create enrichment update_operation in txn - #2076

Merged
github-actions[bot] merged 1 commit into
quay:mainfrom
bradr5:fix-enrichment-update-operation-txn
Dec 3, 2026
Merged

github-actions[bot] merged 1 commit into
quay:mainfrom
bradr5:fix-enrichment-update-operation-txn

Conversation

@bradr5

@bradr5 bradr5 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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.

@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 ?

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>
@crozzy
crozzy force-pushed the fix-enrichment-update-operation-txn branch from ce6981a to 1b13893 Compare December 3, 2026 19:27
@crozzy

crozzy commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Dropping the two moot commits

@crozzy
crozzy force-pushed the fix-enrichment-update-operation-txn branch from 1b13893 to cedb7ce Compare December 3, 2026 19:57
@crozzy

crozzy commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

/fast-forward

@github-actions
github-actions Bot merged commit cedb7ce into quay:main Dec 3, 2026
6 checks passed
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