Bug #39202
closedEliminate redundant Candlepin GETs during host registration
Description
- Problem
Every POST /rhsm/consumers makes three HTTP calls to Candlepin:
1. POST /candlepin/consumers — creates the consumer, returns full JSON
2. GET /candlepin/consumers/{uuid} — in finalize_registration, to feed update_from_consumer_attributes
3. GET /candlepin/consumers/{uuid} — in the controller, for the final render returned to subscription-manager
Calls 2 and 3 are pure overhead. The POST response already contains the complete, canonical consumer state: Candlepin applies activation key entitlements synchronously before returning, and nothing between call 1 and call 3 writes to Candlepin. The consumer state is identical at all three points.
Under concurrent bulk registration (hundreds to thousands of hosts), this multiplies: 1000 registrations generate 2000 unnecessary Candlepin GET calls that compete with the POST traffic itself, contributing directly to Candlepin saturation and the 502 errors observed under load.
Additionally, finalize_registration re-fetched the host from the database immediately after register_host had just saved it, and consumer_activate reloaded the host solely to prepare for a render that now uses the cached consumer data directly.
- Fix
Pass the Candlepin POST response through the call chain (create_in_candlepin -> register_host -> finalize_registration -> controller) so that both downstream GETs are replaced by the already-available data. Also remove the redundant Host.find in finalize_registration and host.reload in consumer_activate.
Net result per registration: 2 fewer Candlepin GET calls, 2 fewer DB SELECTs.
Updated by The Foreman Bot 3 months ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/11694 added
Updated by Ian Ballou 3 months ago
- Category set to Hosts
- Target version set to Katello 4.21.0
- Triaged changed from No to Yes
Updated by The Foreman Bot about 2 months ago
- Fixed in Releases Katello 5.0.0 added
Updated by Anonymous about 2 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|9b3e5ffed331c763d46dcd1b0633f11108d1ce7a.
Updated by The Foreman Bot about 1 month ago
- Fixed in Releases Katello 4.21.0 added