Page MenuHomePhabricator

Check/remove unused databases following labpuppetmaster deprecation
Closed, ResolvedPublic

Description

The puppet masters for Cloud VPS/Toolforge used to be run in production (labpuppetmaster100[2].wikimedia.org). Due to work done by @Krenair and @Andrew they are now running inside Cloud VPS as well. labpuppetmaster* were accessing the m5 production databases, so we should check whether some databases are now no longer needed and to be dropped.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptThu, Sep 19, 7:37 AM
Marostegui moved this task from Triage to Backlog on the DBA board.Thu, Sep 19, 7:39 AM
Marostegui added a subscriber: Marostegui.

This is what m5 has at the moment:

+------------------------+
| Database               |
+------------------------+
| designate              |
| designate_pool_manager |
| glance                 |
| heartbeat              |
| information_schema     |
| keystone               |
| labsdbaccounts         |
| labspuppet             |
| labswiki               |
| labtestwiki            |
| mysql                  |
| neutron                |
| nova                   |
| nova_api               |
| nova_api_eqiad1        |
| nova_eqiad1            |
| ops                    |
| performance_schema     |
| striker                |
| sys                    |
| test_labsdbaccounts    |
| testreduce_0715        |
| testreduce_vd          |
+------------------------+

I guess it is labspuppet what can be dropped?

It's the labspuppet database, yes. Note that the toolforge project has its
own puppetmasters and only they were talking to the central puppetmaster.

What we normally do is, rename all the tables on the given database and leave it like that for a few days to check that nothing is really using it, and then drop it.

Sounds like a good idea, let's do it.

Mentioned in SAL (#wikimedia-operations) [2019-09-19T08:11:30Z] <marostegui> Rename tables on db1133:labspuppet T233281

Marostegui moved this task from Backlog to In progress on the DBA board.

Done:

root@db1133.eqiad.wmnet[labspuppet]> show tables;
+-------------------------+
| Tables_in_labspuppet    |
+-------------------------+
| TO_DROP_hieraassignment |
| TO_DROP_prefix          |
| TO_DROP_roleassignment  |
+-------------------------+
3 rows in set (0.00 sec)

If nothing breaks, let's get rid of the whole database on Monday.

Reminder: Let's check grants too.

Change 538270 had a related patch set uploaded (by Muehlenhoff; owner: Muehlenhoff):
[operations/puppet@production] Remove grants for labpuppet

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

Reminder: Let's check grants too.

Created https://gerrit.wikimedia.org/r/538270 for this

I am going to drop the following grants:

root@db1133.eqiad.wmnet[(none)]> select user,host from mysql.user where user like 'labspuppet';
+------------+----------------+
| user       | host           |
+------------+----------------+
| labspuppet | 208.80.154.158 |
| labspuppet | 208.80.154.92  |
| labspuppet | 208.80.155.120 |
+------------+----------------+
3 rows in set (0.00 sec)
3 rows in set (0.00 sec)

+------------------------------------------------------------------------------------------------------------------------+
| Grants for labspuppet@208.80.154.158                                                                                   |
+------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'labspuppet'@'208.80.154.158' IDENTIFIED BY PASSWORD 'x' |
| GRANT SELECT, INSERT, UPDATE, DELETE, ALTER ON `labspuppet`.* TO 'labspuppet'@'208.80.154.158'                         |
+------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

Mentioned in SAL (#wikimedia-operations) [2019-10-03T06:48:03Z] <marostegui> Drop database grants on m5 for labspuppet - T233281

Mentioned in SAL (#wikimedia-operations) [2019-10-03T07:19:17Z] <marostegui> Remove unused labspuppet database from m5 - T233281

Change 538270 merged by Marostegui:
[operations/puppet@production] Remove grants for labpuppet

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

Marostegui closed this task as Resolved.Thu, Oct 3, 7:21 AM

database dropped:

root@db1133.eqiad.wmnet[labspuppet]> show tables;
+-------------------------+
| Tables_in_labspuppet    |
+-------------------------+
| TO_DROP_hieraassignment |
| TO_DROP_prefix          |
| TO_DROP_roleassignment  |
+-------------------------+
3 rows in set (0.00 sec)

root@db1133.eqiad.wmnet[labspuppet]> drop database if exists labspuppet;
Query OK, 3 rows affected (0.72 sec)