Actions
Bug #23096
closedIndexing subscription facet pools generates sql query per consumer
Description
When a system registers/unregisters the import_hosts method in https://github.com/Katello/katello/blob/master/app/models/katello/glue/candlepin/pool.rb#L146-L155 does the following
- get consumer ids belonging to this pool from candlepin (around 15s)
- loop through the consumer ids and create an entry in SubscriptionFacetPool if it does not exist
- delete bad entries in SubscriptionFacetPool (i.e. delete where facet ids no longer exists)
step 2 generates a query for every consumer id in the pool to verify it exists. In some high volume customer cases that could mean 50K sql queries (all doing a where clause to verify the existence of a subscription facet pool) on every registration. This could also result in edge cases and pain points related errors like
PG::Error: ERROR: insert or update on table \"katello_subscription_facet_pools\" violates foreign key constraint \"katello_sub_facet_pools_sf_id_fk\"\nDETAIL: Key (subscription_facet_id)=(1000) is not present in table \"katello_subscription_facets\".\n: INSERT INTO \"katello_subscription_facet_pools\" (\"pool_id\", \"subscription_facet_id\") VALUES ($1, $2) RETURNING \"id\"
where the slow response causes the registering client to time out and retry with --force causing race conditions.
Updated by The Foreman Bot over 6 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/7280 added
Updated by Partha Aji over 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset katello|3298bb1a72e4b21e0ca5006a4c62dffb50b3d41f.
Updated by John Mitsch over 6 years ago
- Translation missing: en.field_release set to 338
Actions