Red Hat Bugzilla – Bug 1560740
Katello Event Queue db queries need improvement
Last modified: 2018-08-31 11:20 EDT
KatelloEventQueue involves the following operations 1) Pick an event thats not in-progress and mark the rest of the duplicate events below it as "in progress" 2) Do the operation 3) Delete all the duplicates In a large scale environment where over 10's of 1000s of events (with many duplicates) gets queued up in the EventQueue we need a quicker way to handle all 3 The last part seems to delete 1 event at a time instead of deleting the duplicates en masse To test this 1) create activation key with subs attached 2)Do simultaneou/multiple registers and unregisters in quick succession in the 100s , 3) sudo su - postgres; psql foreman; select count(*) from katello_events make sure you have a lot of import_pools running 4) Notice that duplicate events are not immediately cleared after the first event pool. As in they happen slowly other approach to repro this scenario 1) Stop foreman-tasks 2) foreman-rake console 3) Katello::Pool.first.id >> 3 #note down the id 4) 30000.times { ::Katello::EventQueue.push_event(::Katello::Events::ImportPool::EVENT_TYPE, 3) } exit 5) sudo su - postgres; psql foreman; select count(*) from katello_events make sure you have a lot of import_pools running 6) start foreman-tasks 7) Keep monitoring the counts in katello_events It takes a long time to clear all the events and go to 0 (5 min in our demo sat)
Connecting redmine issue http://projects.theforeman.org/issues/22978 from this bug
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/22978 has been resolved.
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-2018:1950