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
Physikerwelt triaged this task as Lowest priority.May 31 2018, 9:45 AM
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 added a subscriber: Marostegui.

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

Physikerwelt closed this task as Declined.Jul 12 2019, 1:45 PM
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.

Physikerwelt updated the task description. (Show Details)Jul 12 2019, 1:55 PM

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 reopened this task as Open.Jul 12 2019, 2:07 PM
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 :-)

jcrespo updated the task description. (Show Details)Jul 12 2019, 2:09 PM
jcrespo added a comment.EditedJul 12 2019, 2:11 PM

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.

Physikerwelt added a comment.EditedJul 12 2019, 2:22 PM

Thank you. See https://github.com/wikimedia/mediawiki-extensions-Math/blob/2c555baf4f758dc0cbe08893a6bcb5ba79916f98/MathTexvc.php#L196 for the code that calculates the location of the image from the hash.

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.

jcrespo reassigned this task from jcrespo to Marostegui.Jul 19 2019, 5:26 PM
Physikerwelt added a comment.EditedJul 19 2019, 8:21 PM

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.

Marostegui updated the task description. (Show Details)Jul 22 2019, 7:17 AM
Marostegui updated the task description. (Show Details)

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)
Marostegui updated the task description. (Show Details)Jul 22 2019, 8:34 AM

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)
Marostegui updated the task description. (Show Details)Aug 1 2019, 12:20 PM

@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 :(

Marostegui updated the task description. (Show Details)Aug 6 2019, 12:20 PM

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

Marostegui updated the task description. (Show Details)Aug 7 2019, 9:18 AM

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

Marostegui updated the task description. (Show Details)Aug 7 2019, 9:25 AM

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

Marostegui updated the task description. (Show Details)Aug 8 2019, 8:51 AM

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

Marostegui updated the task description. (Show Details)Aug 8 2019, 9:27 AM

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

Marostegui updated the task description. (Show Details)Aug 8 2019, 1:09 PM
Marostegui updated the task description. (Show Details)Aug 8 2019, 1:33 PM

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

Marostegui updated the task description. (Show Details)Aug 9 2019, 5:40 AM

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

Marostegui updated the task description. (Show Details)Aug 9 2019, 8:58 AM

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

Marostegui updated the task description. (Show Details)Aug 9 2019, 9:06 AM

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

Marostegui updated the task description. (Show Details)Aug 9 2019, 9:57 AM

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

Marostegui updated the task description. (Show Details)Aug 9 2019, 10:49 AM

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

Marostegui updated the task description. (Show Details)Aug 12 2019, 5:02 AM

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 closed this task as Resolved.Aug 12 2019, 5:47 AM
Marostegui updated the task description. (Show Details)

All done!