Faster alias insert#1934
Draft
crozzy wants to merge 3 commits into
Draft
Conversation
Adds a test that trips an Alias insertion deadlock. Signed-off-by: Hank Donnay <hdonnay@redhat.com> Change-Id: I4f7f613f17e47c7cbcff82fbbb7674a06a6a6964
This fixes a transaction conflict where concurrent updaters could attempt to insert the same alias namespaces and cause the entire update to abort. Signed-off-by: Hank Donnay <hdonnay@redhat.com> Change-Id: I4f7f613f17e47c7cbcff82fbbb7674a06a6a6964
02f985f to
11ccd1a
Compare
Replace the per-vulnerability insertVulnerabilityAliases and insertSelfAlias batch queries — each of which did a hash-lookup subquery against the vuln table — with two single bulk INSERT statements that use unnest() + JOIN to link all vulnerabilities to their aliases and self-references in one pass. The flattened (hash_kind, hash, alias_space, alias_name) arrays accumulated during the vuln iteration are comparable in size to the arrays already built by the insertAliases pre-pass, so memory usage does not grow significantly relative to what was already held. For VEX with a 2-year lookback (~1.1M vulns), this reduces the alias-linking phase from timing out at 30 minutes to ~43 seconds. Signed-off-by: crozzy <joseph.crosland@gmail.com>
11ccd1a to
b7e27ee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.