Red Hat Bugzilla – Bug 1585890
foreman-rake foreman_tasks:cleanup does not remove tasks from foreman_tasks_locks table
Last modified: 2018-08-22 16:07:48 EDT
#foreman-rake foreman_tasks:cleanup does not remove tasks from foreman_tasks_locks table Red Hat Satellite 6.3.1 #su - postgres -c "psql foreman -c 'select * from foreman_tasks_tasks'" |wc -l 19 #su - postgres -c "psql foreman -c 'select * from foreman_tasks_locks'"|wc -l 1125 #foreman-rake foreman_tasks:cleanup TASK_SEARCH="" AFTER=1d After executing the cleanup script, below is the status of the tasks: su - postgres -c "psql foreman -c 'select * from foreman_tasks_tasks'" |wc -l 17 su - postgres -c "psql foreman -c 'select * from foreman_tasks_locks'"|wc -l 1125 Expectation to delete old task from foreman_tasks_locks table.
The following upstream commit has added a "dependent: :destroy" to the lock association to task model. https://github.com/theforeman/foreman-tasks/commit/4c482f45f371edd0e71b5dc2d479c09ebdc52382#diff-20a816cf5bc6c5d3d8f9ff4de1395d55R21
Created redmine issue http://projects.theforeman.org/issues/23814 from this bug
Upstream bug assigned to inecas@redhat.com
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/23814 has been resolved.
Hey Ivan, this failed to cherrypick. Can you take a look?
Turns out we are also missed the cleanup on dynflow_envelopes. We can either manage this as a different bug or include it in this bug
I would consider this being new bug, I will put it here once I file one
[root@sat63-rhel7 ~]# su - postgres -c "psql foreman -c 'select * from foreman_tasks_tasks'" |wc -l 91 [root@sat63-rhel7 ~]# su - postgres -c "psql foreman -c 'select * from foreman_tasks_locks'"|wc -l 523 [root@sat63-rhel7 ~]# foreman-rake foreman_tasks:cleanup TASK_SEARCH="" AFTER=1d Cleaning up 519 orphaned locks [root@sat63-rhel7 ~]# [root@sat63-rhel7 ~]# su - postgres -c "psql foreman -c 'select * from foreman_tasks_tasks'" |wc -l 7 [root@sat63-rhel7 ~]# su - postgres -c "psql foreman -c 'select * from foreman_tasks_locks'"|wc -l As seen it has cleaned up 519 orphaned locks. VERIFIED with Sat6.3.3 snap2
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:2550