-
Spike
-
Resolution: Unresolved
-
Normal
-
None
-
None
-
None
-
5
-
False
-
-
False
-
Impediment
-
subs-candlepin
-
-
Description:
During Satellite upgrades, we run an upgrade task that cleans up any orphaned hosts and unregisters hosts that have missing subscription facets in katello DB. These deletions happen via the DELETE api on consumers: https://github.com/Katello/katello/blob/master/lib/katello/tasks/clean_backend_objects.rake#L46 and as part of unregister here: https://github.com/Katello/katello/blob/master/lib/katello/tasks/clean_backend_objects.rake#L29
Since these happen inside a loop sequentially for all hosts identified for cleanup, in larger environments this is extremely slow making the Satellite upgrade task run for very long.
A bulk delete API would allow for cleaner, faster code in the context of above tasks, improving the upgrade times.
This task is about the low level design of what this work requires. It should take into account extra steps during consumer deletion (events, creation of deleted_consumer entries, etc.).
Another thing to be aware of, is that this task has a lot in common with the InactiveConsumerCleanupJob, in that it does bulk consumer deletion. The design should look into the option of making that code more generic, in order for it to be used as both an on-demand async job, but also the existing scheduled job.
Use cases:
As a user I want to able to delete consumers in bulk with a single API call.
- Input is a list of consumer uuids to be deleted, which are not org scoped.
- This could be an async operation.
- The avg/max amount of consumer uuids to be deleted is unknown, but Katello can make batch calls. Candlepin can specify a limit on the max reasonable size.
- Output: TBD
Acceptance Criteria:
- Design document produced, reviewed by the team, and approved
Additional info:
Opened as part of investigation for https://issues.redhat.com/browse/SAT-32143.
- is related to
-
SAT-32143 Executing the 'katello::clean_backend_objects' rake task takes a long time to complete
-
- Release Pending - Upstream
-