Bug 1459807
Summary: | Apply Errata to a Content Host via incremental C.V. has to wait till Capsule sync of the C.V. finishes | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Pavel Moravec <pmoravec> |
Component: | Errata Management | Assignee: | Jonathon Turel <jturel> |
Status: | CLOSED ERRATA | QA Contact: | Stephen Wadeley <swadeley> |
Severity: | high | Docs Contact: | |
Priority: | medium | ||
Version: | 6.2.10 | CC: | ahumbe, anazmy, bbuckingham, bkearney, jcallaha, rbobek, spetrosi |
Target Milestone: | 6.9.0 | Keywords: | Reopened, Triaged |
Target Release: | Unused | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-04-21 13:11:19 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: |
Description
Pavel Moravec
2017-06-08 08:57:27 UTC
The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Red Hat Technical Support or your account team. If we do not hear from you, we will close this bug out. Thank you. It should be sufficient to insert into (on 6.4): /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.42/app/lib/actions/katello/content_view/incremental_updates.rb : if hosts.any? && !content[:errata_ids].blank? errata = ::Katello::Erratum.with_identifiers(content[:errata_ids]) hosts = hosts.where(:id => ::Katello::Host::ContentFacet.with_applicable_errata(errata).pluck(:host_id)) plan_action(::Actions::Katello::CapsuleContent::Sync, capsule_content.capsule, :environment_id => ... :repository_id => ... :skip_metadata_check => ...) plan_action(::Actions::BulkAction, ::Actions::Katello::Host::Erratum::ApplicableErrataInstall, hosts, content[:errata_ids]) end Add there the ::Actions::Katello::CapsuleContent::Sync - checking if it is sufficient and how to fetch input for the task. Then, Caps sync will be invoked twice, but the 2nd one will be almost no-op so no big issue. (or more trivially from coding point of view, call plan_action(Katello::Repository::CapsuleSync, view, repository) though it will fire _all_ Capsule synces :( ) Patch for 6.4.1 : --- /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.42/app/lib/actions/katello/content_view/incremental_updates.rb.orig 2019-01-24 20:37:19.910159837 +0100 +++ /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.42/app/lib/actions/katello/content_view/incremental_updates.rb 2019-01-24 23:03:27.948047273 +0100 @@ -8,19 +8,43 @@ module Actions old_new_version_map = {} output_for_version_ids = [] + Rails.logger.info("PavelM: hosts=#{hosts.inspect}, content=#{content.inspect}") + if hosts.any? && !content[:errata_ids].blank? + errata = ::Katello::Erratum.with_identifiers(content[:errata_ids]) + hosts = hosts.where(:id => ::Katello::Host::ContentFacet.with_applicable_errata(errata).pluck(:host_id)) + smart_proxies = (hosts.map { |host| host.subscription_facet_attributes.registered_through unless host.subscription_facet_attributes.nil? }).uniq + smart_proxies = (smart_proxies.map { |proxy| SmartProxy.find_by_name(proxy) unless proxy.nil? or SmartProxy.find_by_name(proxy).default_capsule? }).compact + end + sequence do concurrence do version_environments.each do |version_environment| version = version_environment[:content_view_version] + environment = version_environment[:environments] if version.content_view.composite? fail _("Cannot perform an incremental update on a Composite Content View Version (%{name} version version %{version}") % {:name => version.content_view.name, :version => version.version} end - action = plan_action(ContentViewVersion::IncrementalUpdate, version, - version_environment[:environments], :resolve_dependencies => dep_solve, :content => content, :description => description) - old_new_version_map[version] = action.new_content_view_version - output_for_version_ids << {:version_id => action.new_content_view_version.id, :output => action.output} + sequence do + action = plan_action(ContentViewVersion::IncrementalUpdate, version, + environment, :resolve_dependencies => dep_solve, :content => content, :description => description) + Rails.logger.info("PavelM: version=#{version.inspect}, env=#{environment.inspect}") + concurrence do + if defined? smart_proxies + environment.each do |env| + Rails.logger.info("PavelM: env=#{env.inspect}, version.content_view=#{version.content_view.inspect}, smart_proxies=#{smart_proxies.inspect}") + if ::Katello::CapsuleContent.sync_needed?(env) + plan_action(ContentView::CapsuleSync, + version.content_view, + env) + end + end + end + end + old_new_version_map[version] = action.new_content_view_version + output_for_version_ids << {:version_id => action.new_content_view_version.id, :output => action.output} + end end end @@ -29,8 +53,6 @@ module Actions end if hosts.any? && !content[:errata_ids].blank? - errata = ::Katello::Erratum.with_identifiers(content[:errata_ids]) - hosts = hosts.where(:id => ::Katello::Host::ContentFacet.with_applicable_errata(errata).pluck(:host_id)) plan_action(::Actions::BulkAction, ::Actions::Katello::Host::Erratum::ApplicableErrataInstall, hosts, content[:errata_ids]) end plan_self(:version_outputs => output_for_version_ids) The only noticed drawback: Actions::Katello::ContentView::IncrementalUpdates task ends up with warning due to Actions::BulkAction for Caps sync skipped, despite that task completed successfully. Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you. (In reply to Bryan Kearney from comment #8) > Thank you for your interest in Satellite 6. We have evaluated this request, > and while we recognize that it is a valid request, we do not expect this to > be implemented in the product in the foreseeable future. This is due to > other priorities for the product, and not a reflection on the request > itself. We are therefore closing this out as WONTFIX. If you have any > concerns about this, please do not reopen. Instead, feel free to contact Red > Hat Technical Support. Thank you. Bryan, could you reconsider fixing this in 6.6 or later? There is a pending PR: https://github.com/Katello/katello/pull/7946 for it. Identitied a flaw in the process. I check for upstream patches before marking them for deletion, but not after. I will work to address this in future rounds. Re-opening this. -- bk Upstream bug assigned to pmoravec Upstream bug assigned to pmoravec Re-assigning to jturel who has a pending upstream PR. Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/25921 has been resolved. Fix is in Satellite 6.9 SNAP 1 with tfm-rubygem-katello-3.18.0-0.1.rc1.el7sat.noarch 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 |