Page MenuHomePhabricator

Drop FlaggedRevs tables in database for ptwikipedia
Closed, ResolvedPublic

Description

Hi,
ptwikipedia community decided to disable FlaggedRevs extension in T211433.

Too, per T211433#4807955 this community wants to database(s) related to this extension be removed too.

Event Timeline

Kizule changed the task status from Open to Stalled.Dec 10 2018, 7:19 AM
Kizule created this task.
Banyek triaged this task as Medium priority.Dec 10 2018, 2:28 PM
Banyek moved this task from Triage to Backlog on the DBA board.
Urbanecm added a subscriber: Urbanecm.

Doesn't look like a site request to me.

Banyek moved this task from Backlog to next on the User-Banyek board.

ptwikipedia lives in the s2 section, the following hosts needs to be done:

s2

  • db2035 codfw master, execute with replication!
  • db1076
  • db1090
  • db1095
  • db1103
  • db1105
  • db1122
  • dbstore1002
  • db1074 Sanitarium master , execute with replication!
  • db1066 MASTER

ptwikipedia lives in the s2 section, the following hosts needs to be done:

s2

  • db2035 codfw master, execute with replication!
  • db1076
  • db1090
  • db1095
  • db1103
  • db1105
  • db1122
  • dbstore1002
  • db1074 Sanitarium master , execute with replication!
  • db1066 MASTER

And following tables:

MariaDB [ptwiki_p]> show tables like 'flagged%';
+-------------------------------+
| Tables_in_ptwiki_p (flagged%) |
+-------------------------------+
| flaggedimages                 |
| flaggedpage_config            |
| flaggedpage_pending           |
| flaggedpages                  |
| flaggedrevs                   |
| flaggedrevs_promote           |
| flaggedrevs_statistics        |
| flaggedrevs_tracking          |
| flaggedtemplates              |
+-------------------------------+
9 rows in set (0.00 sec)
Kizule changed the task status from Stalled to Open.Dec 12 2018, 8:53 AM

Oh, I forgot to change status to open.

I'll do first renaming the tables on db1122, and if nothing breaks this week, I'll do the drops

Change 479205 had a related patch set uploaded (by Banyek; owner: Banyek):
[operations/mediawiki-config@master] mariadb: depooling db1122 for renaming tables

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

Change 479205 abandoned by Banyek:
mariadb: depooling db1122 for renaming tables

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

Mentioned in SAL (#wikimedia-operations) [2018-12-12T14:43:54Z] <banyek> renaming tables on db1122 ptwiki: flagged* -> T211544_flagged* - T211544

Tables were renamed on db1122 for proof:

root@cumin2001:~# mysql.py -hdb1122 ptwiki -e "show tables like '%flagged%';"
+-----------------------------+
| Tables_in_ptwiki (%flagged%) |
+-----------------------------+
| flaggedimages               |
| flaggedpage_config          |
| flaggedpage_pending         |
| flaggedpages                |
| flaggedrevs                 |
| flaggedrevs_promote         |
| flaggedrevs_statistics      |
| flaggedrevs_tracking        |
| flaggedtemplates            |
+-----------------------------+
root@cumin2001:~# for table in flaggedimages flaggedpage_config flaggedpage_pending flaggedpages flaggedrevs flaggedrevs_promote flaggedrevs_statistics flaggedrevs_tracking flaggedtemplates; do mysql.py -hdb1122 ptwiki -e "set session sql_log_bin=0; rename table $table to T211544_$table;"; done
root@cumin2001:~# mysql.py -hdb1122 ptwiki -e "show tables like '%flagged%';"
+--------------------------------+
| Tables_in_ptwiki (%flagged%)   |
+--------------------------------+
| T211544_flaggedimages          |
| T211544_flaggedpage_config     |
| T211544_flaggedpage_pending    |
| T211544_flaggedpages           |
| T211544_flaggedrevs            |
| T211544_flaggedrevs_promote    |
| T211544_flaggedrevs_statistics |
| T211544_flaggedrevs_tracking   |
| T211544_flaggedtemplates       |
+--------------------------------+
Marostegui moved this task from Backlog to Next on the DBA board.Dec 14 2018, 7:19 AM

Nothing breaks, these tables can be dropped.

Kizule moved this task from Inbox to Watching on the User-Kizule board.Dec 18 2018, 9:23 PM
Kizule removed a project: Patch-For-Review.

I've created backups from the actual tables before the drop:

root@db1066:~/backup_T21544# for table in $(mysql -BN -e "show tables like 'flagged%'" ptwiki --skip-ssl); do mysqldump --skip-ssl ptwiki ${table}> ${table}_T211544_backup.sql; done
root@db1066:~/backup_T21544# ls
flaggedimages_T211544_backup.sql       flaggedpage_pending_T211544_backup.sql  flaggedrevs_promote_T211544_backup.sql	  flaggedrevs_T211544_backup.sql	   flaggedtemplates_T211544_backup.sql
flaggedpage_config_T211544_backup.sql  flaggedpages_T211544_backup.sql	       flaggedrevs_statistics_T211544_backup.sql  flaggedrevs_tracking_T211544_backup.sql
root@db1066:~/backup_T21544# ls -lah
total 29M
drwxr-xr-x 2 root   root    4.0K Dec 19 09:18 .
drwxr-xr-x 3 banyek wikidev 4.0K Dec 19 09:15 ..
-rw-r--r-- 1 root   root    2.0K Dec 19 09:19 flaggedimages_T211544_backup.sql
-rw-r--r-- 1 root   root    2.3K Dec 19 09:19 flaggedpage_config_T211544_backup.sql
-rw-r--r-- 1 root   root    2.1K Dec 19 09:19 flaggedpage_pending_T211544_backup.sql
-rw-r--r-- 1 root   root    2.2K Dec 19 09:19 flaggedpages_T211544_backup.sql
-rw-r--r-- 1 root   root    3.9M Dec 19 09:19 flaggedrevs_promote_T211544_backup.sql
-rw-r--r-- 1 root   root     24M Dec 19 09:19 flaggedrevs_statistics_T211544_backup.sql
-rw-r--r-- 1 root   root    1.2M Dec 19 09:19 flaggedrevs_T211544_backup.sql
-rw-r--r-- 1 root   root    2.2K Dec 19 09:19 flaggedrevs_tracking_T211544_backup.sql
-rw-r--r-- 1 root   root    2.1K Dec 19 09:19 flaggedtemplates_T211544_backup.sql

Mentioned in SAL (#wikimedia-operations) [2018-12-19T09:37:00Z] <banyek> dropping tables with 'T211544' prefix on db1122 - T211544

Mentioned in SAL (#wikimedia-operations) [2018-12-19T09:37:00Z] <banyek> dropping tables with 'T211544' prefix on db1122 - T211544

root@db1122.eqiad.wmnet[ptwiki]> SET SESSION sql_log_bin=0;
Query OK, 0 rows affected (0.03 sec)

root@db1122.eqiad.wmnet[ptwiki]> show tables like 'T211544%';
+--------------------------------+
| Tables_in_ptwiki (T211544%)    |
+--------------------------------+
| T211544_flaggedimages          |
| T211544_flaggedpage_config     |
| T211544_flaggedpage_pending    |
| T211544_flaggedpages           |
| T211544_flaggedrevs            |
| T211544_flaggedrevs_promote    |
| T211544_flaggedrevs_statistics |
| T211544_flaggedrevs_tracking   |
| T211544_flaggedtemplates       |
+--------------------------------+
9 rows in set (0.03 sec)

root@db1122.eqiad.wmnet[ptwiki]> DROP TABLE T211544_flaggedimages;
Query OK, 0 rows affected (0.11 sec)

root@db1122.eqiad.wmnet[ptwiki]> DROP TABLE T211544_flaggedpage_config;
Query OK, 0 rows affected (0.12 sec)

root@db1122.eqiad.wmnet[ptwiki]> DROP TABLE T211544_flaggedpage_pending;
Query OK, 0 rows affected (0.11 sec)

root@db1122.eqiad.wmnet[ptwiki]> DROP TABLE T211544_flaggedpages;
Query OK, 0 rows affected (0.11 sec)

root@db1122.eqiad.wmnet[ptwiki]> DROP TABLE T211544_flaggedrevs;
Query OK, 0 rows affected (0.11 sec)

root@db1122.eqiad.wmnet[ptwiki]> DROP TABLE T211544_flaggedrevs_promote;
Query OK, 0 rows affected (0.12 sec)

root@db1122.eqiad.wmnet[ptwiki]> DROP TABLE T211544_flaggedrevs_statistics;
Query OK, 0 rows affected (0.12 sec)

root@db1122.eqiad.wmnet[ptwiki]> DROP TABLE T211544_flaggedrevs_tracking;
Query OK, 0 rows affected (0.11 sec)

root@db1122.eqiad.wmnet[ptwiki]> DROP TABLE T211544_flaggedtemplates;
Query OK, 0 rows affected (0.12 sec)

Mentioned in SAL (#wikimedia-operations) [2018-12-19T09:53:38Z] <banyek> dropping tables 'flagged%' on db1066 ptwiki with replication enabled - T211544

root@db1066.eqiad.wmnet[ptwiki]> show tables like 'flagged%';
+-----------------------------+
| Tables_in_ptwiki (flagged%) |
+-----------------------------+
| flaggedimages               |
| flaggedpage_config          |
| flaggedpage_pending         |
| flaggedpages                |
| flaggedrevs                 |
| flaggedrevs_promote         |
| flaggedrevs_statistics      |
| flaggedrevs_tracking        |
| flaggedtemplates            |
+-----------------------------+
9 rows in set (0.03 sec)

root@db1066.eqiad.wmnet[ptwiki]> DROP TABLE IF EXISTS flaggedimages;
Query OK, 0 rows affected (0.14 sec)

root@db1066.eqiad.wmnet[ptwiki]> DROP TABLE IF EXISTS flaggedpage_config;
Query OK, 0 rows affected (0.12 sec)

root@db1066.eqiad.wmnet[ptwiki]> DROP TABLE IF EXISTS flaggedpage_pending;
Query OK, 0 rows affected (0.13 sec)

root@db1066.eqiad.wmnet[ptwiki]> DROP TABLE IF EXISTS flaggedpages;
Query OK, 0 rows affected (0.12 sec)

root@db1066.eqiad.wmnet[ptwiki]> DROP TABLE IF EXISTS flaggedrevs;
Query OK, 0 rows affected (0.13 sec)

root@db1066.eqiad.wmnet[ptwiki]> DROP TABLE IF EXISTS flaggedrevs_promote;
Query OK, 0 rows affected (0.11 sec)

root@db1066.eqiad.wmnet[ptwiki]> DROP TABLE IF EXISTS flaggedrevs_statistics;
Query OK, 0 rows affected (0.14 sec)

root@db1066.eqiad.wmnet[ptwiki]> DROP TABLE IF EXISTS flaggedrevs_tracking;
Query OK, 0 rows affected (0.12 sec)

root@db1066.eqiad.wmnet[ptwiki]> DROP TABLE IF EXISTS flaggedtemplates;
Query OK, 0 rows affected (0.12 sec)

root@db1066.eqiad.wmnet[ptwiki]> show tables like 'flagged%';
Empty set (0.04 sec)

root@db1066.eqiad.wmnet[ptwiki]>
Banyek closed this task as Resolved.Dec 19 2018, 10:11 AM