#1647 Write a script to cleanup Duffy DB after retiring a pool
Closed: Fixed by gwmngilfen. Opened by gwmngilfen.

When we retire a Duffy pool, the information about that pool persists in the database. This means Zabbix never stops monitoring old pools, because we connect to the DB to retrieve pool info.

We should write a small SQL script we can run against the DB when retiring a pool to clean up the data. Chatting with @nphilipp that would seem to be simply deleting from the sessions_nodes join-table, and then from sessions and nodes, all where pool = 'thing-we-are-removing.

We can add this to the Duffy Ansible role and have it available on-disk for use.


Metadata Update from @gwmngilfen:
- Issue assigned to gwmngilfen

Metadata Update from @arrfab:
- Issue tagged with: centos-ci-infra

https://github.com/CentOS/ansible-role-duffy/pull/17 creates and deploys the required script. I can't see a good way to automate it - we'd have to:

  • get Ansible to register output for the pools in the DB
  • remove from that list the pools in 70_nodepools
  • run the script for any remaining entries

That feels brittle, so I'm leaving it as manual, since we'd manually have to delete entries from 70_nodepools anyway...

https://github.com/CentOS/ansible-role-duffy/pull/17 was merged, and docs are in progress at https://git.centos.org/centos/centos-infra-docs/pull-request/12 - closing as done.

Metadata Update from @gwmngilfen:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

Log in to comment on this ticket.

Metadata