Page MenuHomePhabricator

Remove table `math` from the database
Closed, ResolvedPublic

Description

This step can not be undone and should be planned carefully, both for private wikis and WMF.
The first caveat is that the location of the old PNG images is stored in the database only. Thus after the DB table is dropped, deleting the whole folder is the only remaining option to get rid of the images.

Current status:

From the extension, everything is ready. All the code has been deleted T195847. cluster access is needed to decide if information is needed from the table to find the images of rendered mathematical expressions. Research that and if yes, search a path forward, if not, delete and/or archive.

Dropping progress:

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Vvjjkkii renamed this task from Remove table `math` from the database to cxbaaaaaaa.Jul 1 2018, 1:06 AM
Vvjjkkii raised the priority of this task from Lowest to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
Scott renamed this task from cxbaaaaaaa to Remove table `math` from the database.Jul 1 2018, 5:14 PM
Scott lowered the priority of this task from High to Lowest.
Scott updated the task description. (Show Details)
Scott added a subscriber: Aklapper.
Marostegui subscribed.

Removing DBA and SRE, please add the tags back once this is ready to go.

This comment was removed by Physikerwelt.

@Marostegui I don't know what I could do to make the task more ready. I will just close the task. Maybe it's best to keep the table forever.

Why declining it? We are waiting for the blocking work to own this, but nobody seems to be progressing on it.

I don't know what I could do to make the task more ready. I will just close the task. Maybe it's best to keep the table forever.

According to the summary "Please don't do this, this is not ready". If it is ready, it should be said so on the summary and added the tags as Manuel mentioned.

Why declining it? We are waiting for the blocking work to own this, but nobody seems to be progressing on it.

I declined it because I do not see any reason why this might change in the future.

According to the summary "Please don't do this, this is not ready". If it is ready, it should be said so on the summary and added the tags as Manuel mentioned.

I removed my general comment that there might be other things from the description. In the last year, nothing came to my mind.

Sorry, but I may not be understanding your comments. Is the extension on WMF ready to have them deleted, if yes, please say so ("please delete ASAP") on the summary. Deleting things carefuly should take less than a week. If you don't have time to do the preparation needed/there is a blocker, I am ok with closing it, although I would mention it also on the summary what is the pending work because may be someone else can do it in the future. :-D

From the extension, everything is ready. All the code has been deleted T195847. As a volunteer contributor, I cannot decide if the system administrators need information from the table to find the images of rendered mathematical expressions. So I simply don't know what to do, sorry:-(

jcrespo claimed this task.
jcrespo added a project: DBA.

Thanks, if you allow me- I will copy that and reopen so this is still tracked. And maybe I can check or delete on a low traffic db and see what are the results. If you have time, you can help us with your knowledge and my access to figure it out :-)

See, we had a bit of a communication loss here, but we may be able to move forward :-D Each person only has a limited amount of information. I will give a look and do some tests and (if you can) I may ask additional questions. Requesting for help is always ok, and we are here to help. :-) Thanks for yours! We are the people most interested on cleaning up the existing tables.

@jcrespo it would be sufficent if you keep a backup of the table somewhere. The outputhash column can not be reconstructed. Only with that one could find all the old images (if they have not already been deleted).

Thanks, that is great info, I will come back with a list of images and/or a dump at the beginning of next week.

So I have left a dump of the math table on public wikis at: https://people.wikimedia.org/~jynus/math.tar There is an example of the format of the tar at: https://people.wikimedia.org/~jynus/aawiki-math.sql I have also backed up the private and closed ones for short term. What would it be the next steps, comparing the hashes with existing images?

Sorry for the late reply. It was a busy week.
Yes. You can now search if there are still images on the servers. Unfortunately, I do not know where to search. The path configuration should still be in the current server configuration. Independent of this effort, the table can be dropped.

Looking for the config I realized that the following config variables are outdated and point to most likely undefined locations.

https://github.com/wikimedia/operations-mediawiki-config/blob/78cbf9587caad345a40860ece38afa53909f89a2/wmf-config/CommonSettings.php#L2658-L2660

I found the following hints to the FileBackend for Math

https://github.com/wikimedia/operations-mediawiki-config/blob/a304a37a062b15a64eff6a27b898a71a7a83aa83/wmf-config/InitialiseSettings-labs.php#L154
https://github.com/wikimedia/operations-mediawiki-config/blob/3f9b9f79efcdbb4c39c1688bc680a7e32f76ef72/wmf-config/filebackend.php#L116

I am not sure if it's worth a separate task to a) remove the file backend functionality that was only used by the math extension and b) to remove the outdated configuration.

So, for the table drop what I will do will be.
Drop the table from a enwiki on a codfw replica (passive DC) to make sure there are no writes (if there are, replication will break and we'll know).
Will leave it for a few days, and if nothing breaks, I will rename the table on a eqiad (active DC) enwiki replica, and will monitor the error log to make sure nothing reads from it.
If there are also no issues, I will go ahead and start dropping it everywhere.

Mentioned in SAL (#wikimedia-operations) [2019-07-22T08:33:41Z] <marostegui> Rename table enwiki.math on db2116 T196055

I have renamed the table on db2116: enwiki:

root@db2116.codfw.wmnet[enwiki]> show tables like 'TO_DRO%';
+----------------------------+
| Tables_in_enwiki (TO_DRO%) |
+----------------------------+
| TO_DROP_math               |
+----------------------------+
1 row in set (0.04 sec)

Mentioned in SAL (#wikimedia-operations) [2019-08-01T12:18:58Z] <marostegui> Rename math table on db1089 (enwiki) - T196055

Renamed on db1089 on enwiki:

root@db1089.eqiad.wmnet[enwiki]>  show tables like 'TO_DRO%';
+----------------------------+
| Tables_in_enwiki (TO_DRO%) |
+----------------------------+
| TO_DROP_math               |
+----------------------------+
1 row in set (0.00 sec)

@Physikerwelt there have been no errors or writes to the tables after T196055#5352527 and T196055#5384177 - I am thinking about starting to drop it everywhere this week.

@Marostegui that's good news. Go ahead. BTW. I checked the code again and found some leftovers https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Math/+/524592/ if you have some spare time maybe you can have a look.

Thanks for double checking!
Regarding that patch, I can take a look but I am not familiar with the code, so I am afraid I won't be too helpful there :(

Mentioned in SAL (#wikimedia-operations) [2019-08-07T09:14:53Z] <marostegui> Drop math table from s6 - T196055

Change 528724 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/puppet@production] maintain-views.yaml: Remove math table

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

Mentioned in SAL (#wikimedia-operations) [2019-08-08T08:36:57Z] <marostegui> Remove math table from s5 T196055

Mentioned in SAL (#wikimedia-operations) [2019-08-08T09:26:11Z] <marostegui> Drop table math from labswiki (wikitech) and labtestwiki T196055

Mentioned in SAL (#wikimedia-operations) [2019-08-08T13:09:13Z] <marostegui> Drop table math from s8 T196055

Change 528724 merged by Marostegui:
[operations/puppet@production] maintain-views.yaml: Remove math table

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

Mentioned in SAL (#wikimedia-operations) [2019-08-09T05:37:15Z] <marostegui> Run maintain-views script with --clean to clean up math table views - T196055

Change 529317 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/puppet@production] dbproxy1010: Depool labsdb1011

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

Change 529317 merged by Marostegui:
[operations/puppet@production] dbproxy1010: Depool labsdb1011

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

Mentioned in SAL (#wikimedia-operations) [2019-08-09T08:24:54Z] <marostegui> Reload haproxy on dbproxy1010 to depool labsdb1011 - T196055

Mentioned in SAL (#wikimedia-operations) [2019-08-09T08:58:52Z] <marostegui> Reload haproxy on dbproxy1010 to repool labsdb1011 - T196055

Mentioned in SAL (#wikimedia-operations) [2019-08-09T09:04:18Z] <marostegui> Drop math table from s4 - T196055

Mentioned in SAL (#wikimedia-operations) [2019-08-09T09:35:59Z] <marostegui> Drop math table from s7 T196055

Change 529346 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/puppet@production] filtered_tables: Remove math table

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

Mentioned in SAL (#wikimedia-operations) [2019-08-12T05:02:03Z] <marostegui> Remove math table from s1 - T196055

Mentioned in SAL (#wikimedia-operations) [2019-08-12T05:04:33Z] <marostegui> Remove math table from s3 - T196055

Change 529346 merged by Marostegui:
[operations/puppet@production] filtered_tables: Remove math table

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

Marostegui updated the task description. (Show Details)

All done!