Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1431783 - Stop calling back to candlepin for qpid messages
Stop calling back to candlepin for qpid messages
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Subscription Management (Show other bugs)
6.2.9
Unspecified Unspecified
high Severity high (vote)
: 6.2.11
: Unused
Assigned To: Justin Sherrill
Chris Brown
: Performance, PrioBumpField, Triaged
: 1414159 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-13 14:05 EDT by Justin Sherrill
Modified: 2017-08-10 13:02 EDT (History)
9 users (show)

See Also:
Fixed In Version: katello-3.4.0 tfm-rubygem-katello-3.0.0.138-1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1463808 (view as bug list)
Environment:
Last Closed: 2017-08-10 13:02:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Green content host status (100.45 KB, image/png)
2017-07-28 10:39 EDT, Chris Brown
no flags Details
Red content host status (111.39 KB, image/png)
2017-07-28 10:39 EDT, Chris Brown
no flags Details
Red Hat Subscriptions screenshot (68.15 KB, image/png)
2017-07-28 10:44 EDT, Chris Brown
no flags Details
Green status from UI (119.60 KB, image/png)
2017-07-28 12:36 EDT, Chris Brown
no flags Details
FAILED- Red status from UI (99.79 KB, image/png)
2017-07-28 12:40 EDT, Chris Brown
no flags Details
Red status from UI (84.48 KB, image/jpeg)
2017-07-28 12:44 EDT, Chris Brown
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 19026 None None None 2017-03-24 15:20 EDT
Foreman Issue Tracker 20329 None None None 2017-07-20 11:02 EDT
Red Hat Product Errata RHBA-2017:2466 normal SHIPPED_LIVE Satellite 6.2.11 Async Release 2017-08-10 17:01:20 EDT

  None (edit)
Description Justin Sherrill 2017-03-13 14:05:58 EDT
Description of problem:

Currently candlepin is sending large messages through candlepin and we are taking these messages, pulling out some ID and fetching the data from candlepin.  All the data we need is right there.  We should just use it directly.  This should speed up processing of events considerably.
Comment 3 Justin Sherrill 2017-03-24 15:20:55 EDT
Created redmine issue http://projects.theforeman.org/issues/19026 from this bug
Comment 4 Pavel Moravec 2017-04-20 09:15:41 EDT
Do I understand this BZ right, that currently:

For some events sent from candlepin to katello via katello_event_queue, katello contacts candlepin to do some redundant update/query?

Since I was testing few types of events sent from candlepin->katello and no candlepin request was generated for either of them.

Is one such event type "compliance.created" ?

And if katello tries to contact candlepin but candlepin is down, does it raise "A backend service [ Candlepin ] is unreachable" error and is ListenOnCandlepinEvents task paused in error state?

Will a fix of this BZ help also to this behaviour (temporary candlepin down pauses L.O.C.E. task forever, causing the katello_event_queue backlog grows over time)?
Comment 5 pm-sat@redhat.com 2017-04-22 02:19:01 EDT
Upstream bug assigned to jsherril@redhat.com
Comment 6 pm-sat@redhat.com 2017-04-22 02:19:05 EDT
Upstream bug assigned to jsherril@redhat.com
Comment 7 pm-sat@redhat.com 2017-04-27 12:17:42 EDT
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/19026 has been resolved.
Comment 8 Justin Sherrill 2017-05-15 11:21:06 EDT
Pavel, I'm not aware of that issue, but yes if it is an issue it should resolve it.  

Currently we look for:

entitlement.create
entitlement.deleted
pool.created
pool.deleted
compliance.created

Prior to this BZ's fix we were going to candlepin to fetch either pool info, or consumer info for every single one these messages.  An expiring manifest could cause 10,000 - 20,000 of these messages to flood in.

Now we've made a couple of changes:

compliance.created does not contact candlepin at all.

The other 4 types are cause 'events' to be put on the katello event queue (an in database queue that is processed by the "Katello Event Monitor" task.  This task should features some de-duplication built in, so that 10,000 entitlement.create or delete messages on the same pool would only result in a handful of calls to candlepin.
Comment 10 Justin Sherrill 2017-07-20 11:02:21 EDT
Adding 2nd upstream issue and moving to POST
Comment 11 Justin Sherrill 2017-07-20 11:12:21 EDT
There are several scenarios that need to be tested for a) correct functionality and b) that extra calls aren't making it to candlepin


Scenario A)
1. make sure you have a manifest imported
2. Register a rhel content host
3. run subscription-manager attach --auto
4. check subscription status and verify it should be green
5. run subscription-manager remove --all
6. check subscription status and verify it should be red

Scenario B)

1. make sure you have a manifest imported
2. Register a rhel content host
3. Attach a redhat subscription via the UI
4. check subscription status and verify it should be green
5. Remove the subscription from the UI
6. check subscription status and verify it should be red

Scenario C)
1.  Import a manifest, verify that all subscriptions and pools show up properly on the Red Hat Subscriptions Page


Scenario D) 
1.  Import a manifest with at least 50-100 Subs
2.  Register at least 50-100 systems, and have them attach the subs from the manifest.  These do not need to be 'real' systems
3.  Monitor /var/log/candlepin/candlepin.log and look for "Request"
4.  On 6.2.10 you likely would see at least 200 requests (2 per system) hitting candlepin. (I would try this on a 6.2.10 box so that you are confident in the behavior).
5.  On 6.2.11 you should not see 2 requests per system.  You may see a handful (especially around the deletion, but nowhere near 2 per system).
Comment 13 Chris Brown 2017-07-28 10:39 EDT
Created attachment 1305977 [details]
Green content host status

subscription-manager attach --auto
Comment 14 Chris Brown 2017-07-28 10:39 EDT
Created attachment 1305978 [details]
Red content host status

subscription-manager remove --all
Comment 15 Chris Brown 2017-07-28 10:44 EDT
Created attachment 1305979 [details]
Red Hat Subscriptions screenshot
Comment 16 Chris Brown 2017-07-28 12:36 EDT
Created attachment 1305997 [details]
Green status from UI

Attached subscriptions through web UI
Comment 17 Chris Brown 2017-07-28 12:40 EDT
Created attachment 1305998 [details]
FAILED- Red status from UI

After deleting RH subscriptions using the web UI the content host status was green but expected red.
Comment 18 Chris Brown 2017-07-28 12:44 EDT
Created attachment 1305999 [details]
Red status from UI

Deleting subscriptions from content host changed status to red.
Comment 19 Chris Brown 2017-07-28 15:34:59 EDT
-bash-4.2# grep -c "Request" /var/log/candlepin/candlepin.log 
242

-bash-4.2# grep -c "Request" /var/log/candlepin/candlepin.log 
134
Comment 20 Chris Brown 2017-07-28 15:46:14 EDT
Verified in Satellite 6.2.11 Snap 2
Comment 21 Chris Duryee 2017-07-31 15:33:57 EDT
*** Bug 1414159 has been marked as a duplicate of this bug. ***
Comment 23 errata-xmlrpc 2017-08-10 13:02:29 EDT
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:2466

Note You need to log in before you can comment on or make changes to this bug.