Project

General

Profile

Actions

Bug #39202

closed

Eliminate redundant Candlepin GETs during host registration

Added by Pablo Méndez Hernández 3 months ago. Updated 3 days ago.

Status:
Closed
Priority:
High
Category:
Hosts
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

  1. 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.

  1. 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.

Actions #1

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
Actions #2

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
Actions #3

Updated by Ian Ballou 3 months ago

  • Assignee set to Pablo Méndez Hernández
Actions #4

Updated by The Foreman Bot about 2 months ago

  • Fixed in Releases Katello 5.0.0 added
Actions #5

Updated by Anonymous about 2 months ago

  • Status changed from Ready For Testing to Closed
Actions #6

Updated by The Foreman Bot about 1 month ago

  • Fixed in Releases Katello 4.21.0 added
Actions #7

Updated by Ewoud Kohl van Wijngaarden 3 days ago

  • Red Hat JIRA set to SAT-46106
Actions

Also available in: Atom PDF