Page MenuHomePhabricator

Drop puppet database from m1
Closed, ResolvedPublic

Description

As specified by Alex at: T231403#5450560 the puppet database can be removed from m1 hosts as servermon is no longer.

We should take a final logical backup, get the tables renamed for a few days and if nothing breaks, remove it completely.
It indeed looks un-used

root@db1063:/srv/sqldata/puppet# ls -lhrt *.ibd | tail -n 5
-rw-r----- 1 mysql mysql  12M Jul 11 11:09 fact_names.ibd
-rw-r----- 1 mysql mysql 8.0M Jul 13 17:28 hosts.ibd
-rw-r----- 1 mysql mysql 8.0M Jul 13 17:32 updates_package.ibd
-rw-r----- 1 mysql mysql 132M Jul 13 17:32 fact_values.ibd
-rw-rw---- 1 mysql mysql  29M Jul 16 09:06 updates_update.ibd

root@db1063:/srv/sqldata/puppet# du -sh .
373M	.

We should also clean up the grants for the puppet user.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptThu, Aug 29, 11:04 AM
Marostegui triaged this task as Normal priority.Thu, Aug 29, 11:04 AM
Marostegui moved this task from Triage to Next on the DBA board.
Marostegui moved this task from Next to In progress on the DBA board.

I have left a backup of this DB at:

cumin1001:/home/marostegui/T231539

Mentioned in SAL (#wikimedia-operations) [2019-09-03T05:22:16Z] <marostegui> Rename tables on the puppet database on m1 master - T231539

I have renamed the tables on the puppet DB, I will leave them for a few hours before dropping the database:

# mysql.py -hdb1063 puppet -e "show tables" -BN
TO_DROP_auth_group
TO_DROP_auth_group_permissions
TO_DROP_auth_message
TO_DROP_auth_permission
TO_DROP_auth_user
TO_DROP_auth_user_groups
TO_DROP_auth_user_user_permissions
TO_DROP_django_admin_log
TO_DROP_django_content_type
TO_DROP_django_migrations
TO_DROP_django_session
TO_DROP_django_site
TO_DROP_fact_names
TO_DROP_fact_values
TO_DROP_hosts
TO_DROP_hwdoc_datacenter
TO_DROP_hwdoc_email
TO_DROP_hwdoc_equipment
TO_DROP_hwdoc_equipmentmodel
TO_DROP_hwdoc_person
TO_DROP_hwdoc_person_emails
TO_DROP_hwdoc_person_phones
TO_DROP_hwdoc_phone
TO_DROP_hwdoc_project
TO_DROP_hwdoc_rack
TO_DROP_hwdoc_rackmodel
TO_DROP_hwdoc_rackposition
TO_DROP_hwdoc_rackrow
TO_DROP_hwdoc_role
TO_DROP_hwdoc_servermanagement
TO_DROP_hwdoc_storage
TO_DROP_hwdoc_ticket
TO_DROP_hwdoc_ticket_equipment
TO_DROP_hwdoc_vendor
TO_DROP_keyvalue_key
TO_DROP_keyvalue_keyvalue
TO_DROP_param_names
TO_DROP_param_values
TO_DROP_puppet_tags
TO_DROP_resource_tags
TO_DROP_resources
TO_DROP_source_files
TO_DROP_south_migrationhistory
TO_DROP_test_params
TO_DROP_updates_package
TO_DROP_updates_update

Change 534576 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/puppet@production] production-m1: Remove puppet grants

https://gerrit.wikimedia.org/r/534576

Change 534576 merged by Marostegui:
[operations/puppet@production] production-m1: Remove puppet grants

https://gerrit.wikimedia.org/r/534576

Mentioned in SAL (#wikimedia-operations) [2019-09-05T07:45:11Z] <marostegui> Remove puppet grants from m1 for the following IPs: 10.64.0.165 10.64.16.159 10.64.16.18 T231539

Marostegui added a comment.EditedThu, Sep 5, 7:47 AM

The following grants have been dropped:

root@db1135.eqiad.wmnet[(none)]> drop user if exists 'puppet'@'10.64.0.165';
Query OK, 0 rows affected (0.00 sec)

root@db1135.eqiad.wmnet[(none)]> drop user if exists 'puppet'@'10.64.16.159';
Query OK, 0 rows affected (0.00 sec)

root@db1135.eqiad.wmnet[(none)]> drop user if exists 'puppet'@'10.64.16.18';
Query OK, 0 rows affected (0.00 sec)

root@db1135.eqiad.wmnet[mysql]> select user,host from user where user='puppet';
Empty set (0.00 sec)

And this is the master:

root@db1063.eqiad.wmnet[mysql]> select user,host from user where user='puppet';
Empty set (0.00 sec)

Mentioned in SAL (#wikimedia-operations) [2019-09-11T06:45:18Z] <marostegui> Drop unused database puppet on m1 - T231539

Marostegui closed this task as Resolved.Wed, Sep 11, 6:48 AM

This is all done