Page MenuHomePhabricator

Drop modtoken and flags from cache tables
Open, MediumPublic

Description

Context: T389893: Remove modtoken and multiPrimaryMode from SqlBagOStuff and mainstash
Alter: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1213424/2/sql/mysql/patch-objectcache-drop-modtoken.sql

I'm sure this should be dropped from mainstash tables but it might be also accidentally created in parsercache tables too.

It would be great to check all pcXXX tables across all pcX clusters to see if they have the modtoken column, and if they do, drop them.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Marostegui triaged this task as Medium priority.
Marostegui subscribed.

I remember seeing them in parsercache, I will check anyway.

$ sudo db-mysql pc1011 parsercache -e "show tables like 'objec%'";
+--------------------------------+
| Tables_in_parsercache (objec%) |
+--------------------------------+
| objectcache                    |
+--------------------------------+
$ sudo db-mysql pc1011 parsercache -e "show tables like 'objec%'";
+--------------------------------+
| Tables_in_parsercache (objec%) |
+--------------------------------+
| objectcache                    |
+--------------------------------+

That table probably should be dropped altogether I think. I sorta meant since pc tables (pc101 for example) is created from the objectcache schema, it also might have these two columns)

Yeah they aren't written since 2022 from what I can see

@Ladsgroup I am confused, the patch you linked talks about objectcache table but ms sections do not have that, they have objectstash instead (which does have modtoken), I guess it is a name error?

So the tables are built from the structure of objectcache table. They take the schema of objectcache and use it template to create other tables (see SqlBagOStuff:createTables) and SqlBagOStuff is flexible in terms of the name of the table it needs to query. i.e. the objectcache table schema in core is a template many parts of core use to create tables with other names (including Parser cache tables, main stash tables, etc.)

On ParserCache hosts we instantiate the objectcache template 256 times as pcXXX, like pc128 (wmf-config).

On MainStash hosts we instantiate the template once, like objectstash (wmf-config).

The name is a free form field. There's no requirement for any particular name. We try to make them unique to ease debugging and ease future relocation. The default name of objectcache is thus discouraged anywhere other than core databases (e.g. enwiki.objectcache, metawiki.objectcache). We don't use that in production, but that's what that name would mean to me if I saw it somewhere in a query or error message.

Thank you both. After @Krinkle's message above, I am not sure whether I can proceed deleting them on parsercache or I should wait until the code is cleaned up?

For the ALTER I will just proceed on msX for now.

Thank you both. After @Krinkle's message above, I am not sure whether I can proceed deleting them on parsercache or I should wait until the code is cleaned up?

The code has been cleaned up (i.e. the ALTER has been merged) but note that the column might not exist in pc table (or exists in some but not all clusters) since these two columns were added somewhat recently.

Of course this needs depooling for each alter as the table is around 50G

Depooled pc1011.eqiad.wmnet and pc2011.codfw.wmnet Schema change - marostegui@cumin1003 - T411497

Depooled pc1011.eqiad.wmnet and pc2011.codfw.wmnet Schema change - marostegui@cumin1003 - T411497