Bug 1879126
Summary: | no-op repo sync leads to real-op repo publish in certain situations | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Pavel Moravec <pmoravec> | ||||
Component: | Pulp | Assignee: | satellite6-bugs <satellite6-bugs> | ||||
Status: | CLOSED ERRATA | QA Contact: | Lai <ltran> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 6.7.0 | CC: | bmbouter, dkliban, egolov, ggainey, ipanova, jjansky, ktordeur, mmccune, rchan, ttereshc, wpinheir | ||||
Target Milestone: | 6.9.0 | Keywords: | Triaged | ||||
Target Release: | Unused | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | pulp-2.21.4 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | |||||||
: | 1899310 (view as bug list) | Environment: | |||||
Last Closed: | 2021-04-21 13:17:46 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Pavel Moravec
2020-09-15 13:47:05 UTC
Some minimalistic patch to ignore _changes_ in force_full override config: --- a/pulp/server/controllers/repository.py +++ b/pulp/server/controllers/repository.py @@ -1160,13 +1160,17 @@ def check_publish(repo_obj, dist_id, dis skip_for_predistributor = published_after_predistributor or not \ predistributor_last_published - same_override = dist.last_override_config == config_override - if not same_override: + if not (dist.last_override_config == config_override): # Use raw pymongo not to fire the signal hander model.Distributor.objects( repo_id=repo_obj.repo_id, distributor_id=dist_id).update(set__last_override_config=config_override) + # do not compare force_full from config override - this particular difference itself does not + # determine the need of repo publish + config_override = {k: v for k, v in config_override.items() if k != 'force_full'} + dist.last_override_config = {k: v for k, v in dist.last_override_config.items() if k != 'force_full'} + same_override = dist.last_override_config == config_override # Check if content has not changed since last publish and a predistributor is not defined. unchanged_content_and_no_predistributor = last_published and not last_updated and \ not units_removed and not predistributor_id (a review from pulp devels is welcomed, though..) Pavel, thanks for the patch. It looks reasonable to me. Feel free to open the upstream PR. I'll file the upstream bug. The Pulp upstream bug status is at NEW. Updating the external tracker on this bug. The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug. (In reply to Tanya Tereshchenko from comment #2) > Pavel, thanks for the patch. It looks reasonable to me. > Feel free to open the upstream PR. I'll file the upstream bug. Here you are :) https://github.com/pulp/pulp/pull/3999 (majority of redundant repo publishes were in my case really due to config_override altering from {} to {force_full=False}) The Pulp upstream bug status is at POST. Updating the external tracker on this bug. The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug. All upstream Pulp bugs are at MODIFIED+. Moving this bug to POST. The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug. *** Satellite 6.7.4 and 6.7.5 Hotfix Available *** 1) Download pulp-server-2.21.0.4-2.HOTFIXRHBZ1879126.el7sat.noarch.rpm from this bugzilla to your Satellite 2) stop services: satellite-maintain service stop 3) Install: rpm -Uvh pulp-server-2.21.0.4-2.HOTFIXRHBZ1879126.el7sat.noarch.rpm 4) restart: satellite-maintain service start 5) resume operations Created attachment 1726745 [details]
pulp-server-2.21.0.4-2.HOTFIXRHBZ1879126.el7sat.noarch.rpm
Steps to retest 1. Upload manifest 2. Enabled rhel7 repo (content -> repositories) 3. Sync repo 4. Once repo is sync, resync it 5. Content -> product -> rhel7 product -> rhel7 repo -> select action -> advanced sync. choose Complete sync and sync 6. Once sync is completed, do a regular sync Expected: 3. Should take a long time 4. Should take seconds 5. Should take a long time 6. Should take seconds Actual 3. Regular sync took 46 minutes 4. Took 26 seconds 5. Complete sync took 22 minutes 6. Took 26 seconds Originally, after the complete sync took place and resyncing happens, it took a long time. After the fix, the syncing took seconds to complete which is what step 6 indicates. Verified in 6.9.0_07 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 (Moderate: Satellite 6.9 Release), 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/RHSA-2021:1313 |