-
Notifications
You must be signed in to change notification settings - Fork 181
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
Improve extra key handling #3047
Improve extra key handling #3047
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcalmer while I see that the patch here works for addressing the issue, I think a better approach could be use INSERT INTO... ON CONFLICT DO NOTHING
. That has the advantage of allowing batches of insertions, which is faster than individual ("per object") calls to the lookup stored procedures. That would also allow not to add another "nested insert SP" hack.
This is the pattern I have been using during the reposync speedup, and would recommend keeping it in new code as well.
You can see an example of such patch here:
You can see several other instances of this pattern in backlog.py by grepping for ON CONFLICT DO NOTHING
.
I hope I am not missing any important aspect that would prevent the above approach from working here - in that case just let me know.
4e5ec3f
to
0f38dcf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
4ed8a47
to
02b2b47
Compare
What does this PR change?
Adding new extratag keys during reposync can fail with
This result in failed imports of a bunch of packages. To improve the creation of new keys, this PR declare lookup and insert functions and make use of it in the import code.
Second case found while inserting into rhnPackageKey.
GUI diff
No difference.
Documentation
No documentation needed: only internal and user invisible changes
DONE
Test coverage
No tests: manual
DONE
Links
Fixes #3040
Tracks https://github.com/SUSE/spacewalk/pull/13545
Changelogs
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run: