Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
"hammer repository upload-content --path" command invokes for each and every RPM in the directory foreman task Actions::Katello::Repository::ImportUpload. That task consists of:
Actions::Pulp::Repository::ImportUpload
Actions::Pulp::Repository::DistributorPublish
Actions::Katello::Repository::FilteredIndexContent
dynflow sub-tasks.
Assume one uploads hundreds of RPMs in bulk action to a big repo. Then we call pulp sequence "upload RPM to repo, publish repo" 100times in a row.
If the repo is big in content, every publish can take tens of seconds. Redundantly, since another iteration of the loop will discard the published bits. This can even cause upload package failure per https://bugzilla.redhat.com/show_bug.cgi?id=1402415 .
Please ensure by either way that the DistributorPublish (and I expect FilteredIndexContent as well) is called just once, at the end of the bulk action.
I file the BZ against hammer, though a change in hammer _and_ foreman/katello tasks needs to be done.
Version-Release number of selected component (if applicable):
tfm-rubygem-hammer_cli_katello-0.0.22.26-1.el7sat.noarch
Sat6.2.4
How reproducible:
100%
Steps to Reproduce:
1. Have a big repo (say RHEL6 base one)
2. Bulk upload many RPMs via "hammer repository upload-content --path /tmp/dir_with_many_rpms"
3. Count the time, check for potential failed uploads and for the time spent in individual DistributorPublish sub-tasks.
Actual results:
Huge time, some uploads might fail (if repo publish exceeds hammer timeout, see bz1402415 for reasoning), great deal of the time spent in DistributorPublish steps.
Expected results:
Substantially slower times, no faile uploads, DistributorPublish called just once at the end.
Additional info:
Idea of fix: add option "skip_publish" to Actions::Katello::Repository::ImportUpload and hammer sets it to true for all except the latest RPM upload. skip_publish=true will not trigger the 2 dynflow steps
Verified in Satellite 6.2.9 Snap 3.
In this version, there is a significant decrease in time required to upload multiple rpms into one repository. As you will see in the screenshots (attached) the new version skips the distributor publish. Also, you can notice that repo publishing occurs only after the last rpm is uploaded.
6.2.8
Successfully uploaded file '0dc-foo-cb183-1-1.fc21.x86_64.rpm'.
Successfully uploaded file '0dd-foo-7c0b2-1-1.fc21.x86_64.rpm'.
Successfully uploaded file '0dd-foo-cf700-1-1.fc21.x86_64.rpm'.
real 31m13.457s
user 0m29.723s
sys 0m2.309s
6.2.9 Snap 3
Successfully uploaded file '0dd-foo-7c0b2-1-1.fc21.x86_64.rpm'.
Successfully uploaded file '0dd-foo-cf700-1-1.fc21.x86_64.rpm'.
Publishing Repository.
[......................................................] [100%]
real 13m6.497s
user 0m30.406s
sys 0m2.325s
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2017:1191