Description of problem: notifications do not get cleared from the notification table - this means the notifications table keeps on growing Version-Release number of selected component (if applicable): 5.8.2 How reproducible: all the time Steps to Reproduce: 1.generate notifications for cloudforms 2. 3. Actual results: there is no mechanism in place so notifications never get removed from the database Expected results: the notifications get removed from the db at some point to avoid the table from growing out of control Additional info: did not find any mechanism in app/models/miq_alert.rb that shows how alerts would be removed from the db (from the notifications table)
Proposed purger PR: https://github.com/ManageIQ/manageiq/pull/17046
PR above merged. Of note, we tried a different approached making use of the `expired_in` column that wasn't currently being used, but decided against that since it could just be purged with everything else.
the customer found that table "notification_recipients" also needs to be cleared. [1] ~~~~~~~~~~~~~~ psql -U postgres vmdb_production -c "DELETE FROM notifications n WHERE n.created_at < '$(date -u --date="1 day ago" +"%Y-%m-%d %H:%M")' AND n.notification_type_id IN ( SELECT nt.id FROM notification_types nt WHERE NOT nt.level='warning' AND NOT nt.level='error' );" ~~~~~~~~~~~~~~ if this is correct, how can we clean it?
This question has been responded to in https://bugzilla.redhat.com/show_bug.cgi?id=1568016#c4
Err... comment #5... fat-fingered copy paste.
Entries from notification table can be deleted . Verified in 5.10.0.27.20181128170555_43ed8cb