-
Notifications
You must be signed in to change notification settings - Fork 124
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
Fixed concurrent-ks-tree-syncs by making disttree ID repo-specific. #2851
Conversation
DistributionTree digest and subrepo-names now both end with the pulp-id of the "owning" Repository, making them unique to that repo and therefore protected from concurrent-updates against anything that is changing that Repository. Addon/Variant/Image are transitively made unique by virtue of having their DistributionTree be part of their unique-together. Sub-repo **content** (e.g. Packages et al) are de-duplicated via their existing uniqueness constraints. The end result is a minor increase in Content objects (i.e., DistTrees/Addons/Images/Variants that used to have only one instance are now one-per-containing-repo), and a small impact on subrepo-syncing (since previously-unique subrepos will now have a first-sync that would have been skipped). Content will continue to only be sync'd once. fixes pulp#2278. [nocoverage]
7c1ce84
to
0cdaf52
Compare
See overview/commentary/braindump of the process that got me here, in this doc: https://hackmd.io/@ggainey/subrepo_problem |
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
@ggainey What happens with everything that has already been saved under the old naming scheme, presumably all the cleanup and uniqueness constraints will still work fine?
|
New content will not be created, addon/variant/image WILL be created, because their uniqueness-constrain includes the dist-tree they are pointing to.
No, because they are created when the new disttree shows up and are specific to that disstree.
Whether the digest changes or not, we are going to get new disttrees the first time this goes live - because the "digest" field will be "digest-repoid", which does not currently exist, and therefore this is a 'new' disttree.
Yes - because the new-repo-version processing says "there can be only one disttree", and takes the "new" one, removing the old one. See https://github.com/pulp/pulp_rpm/blob/main/pulp_rpm/app/models/repository.py#L393 Great questions, keep 'em coming! |
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.
Makes sense. @ipanova (and @goosemania if you want to), does this all (and the explanation document https://hackmd.io/@ggainey/subrepo_problem) look good to you as well?
I see that apart from subrepo names, @ggainey made the disttree digest repo specific. That should do the trick. LGTM |
Backport to 3.17: 💚 backport PR created✅ Backport PR branch: Backported as #2860 🤖 @patchback |
Backport to 3.14: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 52a9acc on top of patchback/backports/3.14/52a9accc79e49991a8941622b60485e1845d23a2/pr-2851 Backporting merged PR #2851 into main
🤖 @patchback |
Backport to 3.18: 💚 backport PR created✅ Backport PR branch: Backported as #2861 🤖 @patchback |
@ggainey I reviewed your doc and the PR and all looks good to me expect for the copy usecase. |
Yes, you'll have the "dist-tree and related subrepos named-for repo-A", contained in repo-B. This is weird, and distressing, and exactly what we do today. It's also "harmless"; the most unexpected result happens if we sync repo-A, and only the subrepo-content has changed, it will end up changing the content of repo-B's subrepos as well. Fixing this edge case is going to need its own issue, and some pretty ugly heuristics in copy. |
urgh but i think i can live with that, especially if we end up having pretty ugly heuristics in copy then leaving this as is maybe is a lesser evil, plus as discussed with @ggainey over matrtix "what this PR does, is make the current approach WAY more solid, while leaving one usecase unfixed. Fortunately, the problem introduced by that usecase is "hypothetical" - kickstart-tree-subrepo-content can, theoretically, change, but in "the real world" they are static forever" |
@ggainey Could you file that issue so that we have it documented? |
DistributionTree digest and subrepo-names now both end with the pulp-id of the "owning" Repository, making them unique to that repo and therefore protected from concurrent-updates against anything that is changing that Repository.
Addon/Variant/Image are transitively made unique by virtue of having their DistributionTree be part of their unique-together.
Sub-repo content (e.g. Packages et al) are de-duplicated via their existing uniqueness constraints.
The end result is a minor increase in Content objects (i.e., DistTrees/Addons/Images/Variants that used to have only one instance are now one-per-containing-repo), and a small impact on subrepo-syncing (since previously-unique subrepos will now have a first-sync that would have been skipped). Content will continue to only be sync'd once.
fixes #2278.
fixes #2775.
closes #2304.
[nocoverage]