Issue #1895
closedRecursive RPM unit copies are not recursive
Description
It's possible to create an RPM repository, sync content into it, create a second RPM repository, and recursively copy a unit from the first repository to the second. The steps go something like this:
pulp-admin rpm repo create --repo-id source --feed https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/
pulp-admin rpm repo sync run --repo-id sorce
pulp-admin rpm repo create --repo-id target
pulp-admin rpm repo copy rpm --from-repo-id source --to-repo-id target --str-eq="name=chimpanzee" --recursive
pulp-admin rpm repo content rpm --repo-id target | grep 'Name:'
If a regular copy was done, then only the "chimpanzee" unit should be copied over. But since a recursive copy was done, both the chimpanzee unit and all of its dependencies should be copied over. This isn't happening. As things stand, the --recursive
flag appears to have no effect, and only the "chimpanzee" unit is copied.
The log files contain no tracebacks. journalctl --full
shows only entries like this when a unit is copied from the source repo to the target repo:
May 04 16:52:59 cloud-qe-3.idmqe.lab.eng.bos.redhat.com pulp[1000]: celery.worker.job:INFO: Task pulp.server.managers.repo.unit_association.associate_from_repo[751f08f0-bc56-41b8-950e-834b744cf52c] succeeded in 0.0327394460328s: {'units_successful': [{'unit_key': {'name': u'chimpanzee', 'checksum':...
Tested with Pulp 2.8.3 on Fedora 22 and 23.
Updated by Ichimonji10 almost 8 years ago
Updated by Ichimonji10 almost 8 years ago
Automated test: https://github.com/PulpQE/pulp-smash/pull/227
Updated by mhrivnak almost 8 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to mhrivnak
I've reproduced, and I know roughly why it's broken. The "unit" instances being passed into the plugin from the platform don't have their "requires" field populated, so it looks like they have no requirements. Now we need to figure out the right way to get that field populated.
This patch fixes it, but is sub-optimal because it causes a new db query for every unit that is getting copied.
diff --git a/plugins/pulp_rpm/plugins/importers/yum/depsolve.py b/plugins/pulp_rpm/plugins/importers/yum/depsolve.py
index 5b81bb6..77211f0 100644
--- a/plugins/pulp_rpm/plugins/importers/yum/depsolve.py
+++ b/plugins/pulp_rpm/plugins/importers/yum/depsolve.py
@@ -433,5 +433,7 @@ class Solver(object):
"""
for segment in paginate(units):
for unit in segment:
+ unit.reload('requires')
for require in unit.requires or []:
yield Requirement(**require)
Updated by mhrivnak almost 8 years ago
It appears to have broken here: https://github.com/pulp/pulp_rpm/commit/52efd4c43bf6138334bb9a52c8e98d4d1178e5d7#diff-51b88d515eb899068c7113a46ce0809eL424
Which has been in place since 2.8.0 GA. Thus this is not a regression in the latest beta.
Added by mhrivnak almost 8 years ago
Updated by mhrivnak almost 8 years ago
- Status changed from ASSIGNED to POST
- Platform Release set to 2.8.4
Updated by mhrivnak almost 8 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset e67f56dd31fb0e67c0e96df212b3b991daec9388.
Updated by dkliban@redhat.com almost 8 years ago
- Priority changed from Normal to High
- Severity changed from 2. Medium to 3. High
- Triaged changed from No to Yes
Updated by pthomas@redhat.com almost 8 years ago
- Status changed from MODIFIED to 6
[root@ibm-x3550m3-11 ~]# rpm -qa pulp-server
pulp-server-2.8.4-0.1.beta.git.140.69c02ff.el7.noarch
[root@ibm-x3550m3-11 ~]#
[root@ibm-x3550m3-11 ~]# pulp-admin rpm repo create --repo-id source --feed https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/
Successfully created repository [source]
[root@ibm-x3550m3-11 ~]# pulp-admin rpm repo sync run --repo-id source
+----------------------------------------------------------------------+
Synchronizing Repository [source]
+----------------------------------------------------------------------+
This command may be exited via ctrl+c without affecting the request.
Downloading metadata...
[|]
... completed
Downloading repository content...
[-]
[==================================================] 100%
RPMs: 0/0 items
Delta RPMs: 0/0 items
... completed
Downloading distribution files...
[==================================================] 100%
Distributions: 0/0 items
... completed
Importing errata...
[-]
... completed
Importing package groups/categories...
[-]
... completed
Cleaning duplicate packages...
[-]
... completed
Task Succeeded
Initializing repo metadata
[-]
... completed
Publishing Distribution files
[-]
... completed
Publishing RPMs
[==================================================] 100%
32 of 32 items
... completed
Publishing Delta RPMs
... skipped
Publishing Errata
[==================================================] 100%
4 of 4 items
... completed
Publishing Comps file
[==================================================] 100%
3 of 3 items
... completed
Publishing Metadata.
[-]
... completed
Closing repo metadata
[-]
... completed
Generating sqlite files
... skipped
Publishing files to web
[-]
... completed
Writing Listings File
[-]
... completed
Task Succeeded
[root@ibm-x3550m3-11 ~]# pulp-admin rpm repo create --repo-id target
Successfully created repository [target]
[root@ibm-x3550m3-11 ~]# pulp-admin rpm repo copy rpm --from-repo-id source --to-repo-id target --str-eq="name=chimpanzee" --recursive
This command may be exited via ctrl+c without affecting the request.
[\]
Running...
Copied:
camel-0.1-1-noarch
chimpanzee-0.21-1-noarch
fox-1.1-2-noarch
squirrel-0.1-1-noarch
walrus-5.21-1-noarch
[root@ibm-x3550m3-11 ~]# pulp-admin rpm repo content rpm --repo-id target | grep 'Name:'
Name: squirrel
Name: camel
Name: chimpanzee
Name: walrus
Name: fox
Updated by semyers almost 8 years ago
- Platform Release changed from 2.8.4 to 2.8.5
Updated by semyers almost 8 years ago
- Status changed from 6 to CLOSED - CURRENTRELEASE
fixes recursive copy of rpms
https://pulp.plan.io/issues/1895 fixes #1895