Description of problem: If enable_snapshots is set for a server, entries are made in the RHNSNAPSHOT* tables with every change to every server. Over time, these tables frow without bounds, having a growing impact on space and performance of the Spacewalk instance. The current tool for managing snapshots, sw-system-snapshot, is designed for the system-administrator to manage the snapshots associated with their systems. It has no way to 'see' ALL the snapshots, its use of the public API means it must be invoked with a login/password, and its use of absolute-timestamps, all make it less than useful as a tool for the Spacewalk Administrator. This RFE is to introduce a tool for the Spacewalk-Administrator, to help them stay on top of the RHNSNAPSHOT* situation on their Spacewalk instance. Requirements: * Run on the SW instance itself * Relies on access to /etc/rhn/rhn.conf and direct DB access (i.e., can only be run as root) * For delete, specify number-of-days-old, not absolute-timestamp * Includes some basic reporting capability, to let admin know extent of potential issues.
spacewalk.github: ab71482551c6bcf72495f11b395476e14ef3ea0e New command and manpage, spacewalk-manage-snapshots # spacewalk-manage-snapshots --help Usage: spacewalk-manage-snapshots [--reports [--interval <INTERVAL>] | --delete-older-than <DAYS>] Options: -h, --help show this help message and exit -b ROWS-PER-COMMIT, --batch-size=ROWS-PER-COMMIT Number of rows to delete per commit (default is 1000) -d DAYS, --delete-older-than=DAYS Snapshots DAYS old or older will be purged from the database -i INTERVAL, --interval-older-than=INTERVAL INTERVAL-in-days period to use for --reports (default is 90 days) -r, --reports Report current table-sizes (in rows) for all snapshot- related tables and report on the last four --interval periods for snapshots # # spacewalk-manage-snapshots -r -i 25 rhnsnapshot : 12277 rhnsnapshotchannel : 18400 rhnsnapshotconfigchannel : 0 rhnsnapshotconfigrevision : 0 rhnsnapshotinvalidreason : 6 rhnsnapshotpackage : 3513699 rhnsnapshotservergroup : 31164 rhnsnapshottag : 0 : Snapshot info, 25-day interval : : age(days) : systems : snapshots : : 1-25 : 2 : 6 : : 26-50 : 2 : 12263 : : 51-75 : 3 : 3 : : 76-100 : 1 : 1 : : >100 : 3 : 4 : # # spacewalk-manage-snapshots -d 101 -b 1 Deleting snapshots older than 124 days 12277 snapshots currently 4 snapshots to be deleted, 1 per commit ... 4 snapshots left to purge ... 3 snapshots left to purge ... 2 snapshots left to purge ... 1 snapshots left to purge 12273 snapshots remain # spacewalk-manage-snapshots -r -i 25 Table name : rows rhnsnapshot : 12273 rhnsnapshotchannel : 18396 rhnsnapshotconfigchannel : 0 rhnsnapshotconfigrevision : 0 rhnsnapshotinvalidreason : 6 rhnsnapshotpackage : 3512145 rhnsnapshotservergroup : 31159 rhnsnapshottag : 0 : Snapshot info, 25-day interval : : age(days) : systems : snapshots : : 1-25 : 2 : 6 : : 26-50 : 2 : 12263 : : 51-75 : 3 : 3 : : 76-100 : 1 : 1 : #
spacewalk.github: c970f43b9a9d8881b628424609afad16b551c66e Fixed broken postgresql delete
*** Bug 1559360 has been marked as a duplicate of this bug. ***
*** Bug 1559361 has been marked as a duplicate of this bug. ***
Fixes for the associated closed-as-dup BZs: spacewalk.github: 45e672dd135fe6c3efcaee98acf377aab9b6ad0a 1b3efbd11e5543e6ababccbc033f456bad5384d6 1992cdfe33b5cb0cf2be749efacc01c53178f27b
Moving ON_QA
Spacewalk 2.8 has been released. https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes28