Bug 1255901

Summary: Lock is used to dispatch applicability calculation for a consumer
Product: Red Hat Satellite Reporter: Dennis Kliban <dkliban>
Component: Hosts - ContentAssignee: Chris Duryee <cduryee>
Status: CLOSED ERRATA QA Contact: Renzo Nuccitelli <rnuccite>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: aperotti, bbuckingham, bkearney, bmbouter, cduryee, daniele, daviddavis, dkliban, egolov, ggainey, ipanova, jcallaha, mhrivnak, mmccune, pcreech, pmoravec, rchan, rnuccite, ttereshc, zhunting
Target Milestone: UnspecifiedKeywords: Performance, PrioBumpField, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-runcible-1.11.0-1 pulp-2.8.7.12-1 tfm-rubygem-katello-3.0.0.137-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1446712 (view as bug list) Environment:
Last Closed: 2017-06-20 17:20:37 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:
Bug Depends On:    
Bug Blocks: 1353215    
Attachments:
Description Flags
Errata available screenshot none

Description Dennis Kliban 2015-08-21 20:12:10 UTC
Description of problem:

When a host is registered, an applicability task is kicked off for that consumer. Each task is dispatched with a reservation for 'repository_profile_applicability' resource. This is not a real resource. This causes all these tasks to be processed by a single worker. 

Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
1. Register a few hosts one right after another 
2. Examine Pulp's database - 'reserved_resource' collection
3. 

Actual results:

The reserved_resource collection has 'repository_profile_applicability' resource reserved.

Expected results:

No reserved_resource documents should exist for applicability tasks.

Additional info:

Comment 1 pulp-infra@redhat.com 2015-08-21 20:44:49 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 2 pulp-infra@redhat.com 2015-08-21 20:44:50 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 4 Bryan Kearney 2016-07-08 20:47:31 UTC
Per 6.3 planning, moving out non acked bugs to the backlog

Comment 6 pulp-infra@redhat.com 2017-01-17 17:33:40 UTC
The Pulp upstream bug status is at ASSIGNED. Updating the external tracker on this bug.

Comment 7 pulp-infra@redhat.com 2017-01-26 15:33:43 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 8 pulp-infra@redhat.com 2017-02-08 10:05:13 UTC
The Pulp upstream bug status is at ASSIGNED. Updating the external tracker on this bug.

Comment 9 pulp-infra@redhat.com 2017-02-10 23:03:46 UTC
The Pulp upstream bug status is at CLOSED - WONTFIX. Updating the external tracker on this bug.

Comment 10 Michael Hrivnak 2017-02-11 00:47:13 UTC
Quoting the upstream issue:

"I suggest to use the API call for a single consumer when there is a need to calculate applicability for just one consumer (this is suitable for Katello use cases)."

http://docs.pulpproject.org/dev-guide/integration/rest-api/consumer/applicability.html#generate-content-applicability-for-a-single-consumer

I'm changing the component since there are no additional steps for Pulp to take. Please move it to the right component in case I've chosen the wrong one.

Comment 12 Satellite Program 2017-04-04 16:18:36 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/19076 has been resolved.

Comment 13 Renzo Nuccitelli 2017-05-30 13:10:29 UTC
Once the fix was made by changing API call for, are the initial "Steps to Reproduce" still valid?

Comment 14 Chris Duryee 2017-06-03 15:07:35 UTC
The steps in #0 are still valid.

The way I've been testing it is as follows:

* view qpid queue stats via 'qpid-stat -q --ssl-certificate=/etc/pki/katello/qpid_client_striped.crt -b amqps://localhost:5671 '
* subscribe some hosts to new repos
* view queue stats again

You should see the 'msgIn' and 'msgOut' columns increase for the 'celery' queue. Without the patch, you would see 'reserved-resource-worker-X' increase.

To test this without examining the queue stats, you would need to get applicability regen to run on a large number of hosts and then check if all pulp workers were busy (new behavior), or if just one was busy (old behavior).

Comment 15 Renzo Nuccitelli 2017-06-06 14:21:02 UTC
Worked on Satellite 6.2.10. Moving to VERIFIED.

Comment 17 Chris Duryee 2017-06-06 16:21:43 UTC
The applicability regen did not work in some cases due to 2797. To repro:

* create a new product with a yum repo for https://jlsherrill.fedorapeople.org/fake-repos/needed-errata/

* register a host, subscribe to that product, ensure katello-agent is running and package profiles are being uploaded

* install https://jlsherrill.fedorapeople.org/fake-repos/needed-errata/walrus-0.71-1.noarch.rpm to host (older walrus, not newer)


If no applicable errata are shown in the web UI for the host, then you have hit 2797. If one errata appears, then you're good.

Comment 18 pulp-infra@redhat.com 2017-06-06 17:36:04 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 19 pulp-infra@redhat.com 2017-06-06 17:36:08 UTC
The Pulp upstream bug priority is at High. Updating the external tracker on this bug.

Comment 20 pulp-infra@redhat.com 2017-06-07 14:36:05 UTC
The Pulp upstream bug status is at ASSIGNED. Updating the external tracker on this bug.

Comment 22 pulp-infra@redhat.com 2017-06-07 15:36:07 UTC
The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug.

Comment 24 Renzo Nuccitelli 2017-06-13 15:47:18 UTC
Created attachment 1287373 [details]
Errata available screenshot

As can be seen on attached screen shot, after registering host with old repo the relate errata package was made available on Satellite. So I moved this issue to VERIFIED

Comment 25 pulp-infra@redhat.com 2017-06-14 14:31:37 UTC
The Pulp upstream bug status is at ON_QA. Updating the external tracker on this bug.

Comment 27 errata-xmlrpc 2017-06-20 17:20:37 UTC
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:1553

Comment 28 pulp-infra@redhat.com 2017-06-23 16:02:11 UTC
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.