Page MenuHomePhabricator

Include namespace IDs and their names to mysql wikireplicas (meta_p database)
Open, MediumPublic

Description

Apparently several of my tools rely on the database to provide namespaces for the current wiki. See also: T50625

Event Timeline

bd808 added subscribers: Nosy, jkroll, Tobi_WMDE_SW and 2 others.

From the see also task:

The database exists, and is enduser-provided. Nothing for ops to do here.

This is quite a feat of thread necromancy you have performed @Dispenser. It looks like you are probably reporting two separate and distinct issues at once:

For the first issue, I don't see anything in T50625#488761 that tells us how @coren created the view in the first place, but I have a sneaking suspicion that is was a manually created view rather than something that is automatically maintained. This is probably how the view ended up disappearing. The easiest thing to do today would probably just be to update any documentation to name the s51892_toolserverdb_p database itself rather than the view created alias.
For the second issue the toolserverdb tool maintainers will need to get involved.

@Dispenser can you provide a clear and actionable description of what you are hoping to see changed?

I hope to see a namespace table added to meta_p. And with more thought. Domain isn't needed, dbname should lose _p per Labs convention, and maybe a gender flag to distinguish Benutzer and Benutzerin depending on future MW plans. Here's what it is currently (note: MediaWiki and MediaWiki Diskussion):

SELECT *
FROM s51892_toolserverdb_p.namespacename
WHERE dbname LIKE "dewiki_p"
ORDER BY FLOOR(ns_id/2), ns_is_favorite DESC, ns_type, ns_name;
dbnamedomainns_idns_namens_typens_is_favorite
dewiki_pde.wikipedia.org-2Mediumprimary1
dewiki_pde.wikipedia.org-1Spezialprimary1
dewiki_pde.wikipedia.org-2Mediacanonical0
dewiki_pde.wikipedia.org-1Specialcanonical0
dewiki_pde.wikipedia.org0primary1
dewiki_pde.wikipedia.org1Diskussionprimary1
dewiki_pde.wikipedia.org1Talkcanonical0
dewiki_pde.wikipedia.org2Benutzerprimary1
dewiki_pde.wikipedia.org3Benutzer Diskussionprimary1
dewiki_pde.wikipedia.org2Usercanonical0
dewiki_pde.wikipedia.org3User talkcanonical0
dewiki_pde.wikipedia.org3BDalias0
dewiki_pde.wikipedia.org2Benutzerinalias0
dewiki_pde.wikipedia.org3Benutzerin Diskussionalias0
dewiki_pde.wikipedia.org4Wikipediaprimary1
dewiki_pde.wikipedia.org5Wikipedia Diskussionprimary1
dewiki_pde.wikipedia.org4Projectcanonical0
dewiki_pde.wikipedia.org5Project talkcanonical0
dewiki_pde.wikipedia.org5WDalias0
dewiki_pde.wikipedia.org4WPalias0
dewiki_pde.wikipedia.org6Dateiprimary1
dewiki_pde.wikipedia.org7Datei Diskussionprimary1
dewiki_pde.wikipedia.org6Filecanonical0
dewiki_pde.wikipedia.org7File talkcanonical0
dewiki_pde.wikipedia.org6Bildalias0
dewiki_pde.wikipedia.org7Bild Diskussionalias0
dewiki_pde.wikipedia.org6Imagealias0
dewiki_pde.wikipedia.org7Image talkalias0
dewiki_pde.wikipedia.org9MediaWiki Diskussionprimary1
dewiki_pde.wikipedia.org8MediaWikicanonical1
dewiki_pde.wikipedia.org9MediaWiki talkcanonical0
dewiki_pde.wikipedia.org10Vorlageprimary1
dewiki_pde.wikipedia.org11Vorlage Diskussionprimary1
dewiki_pde.wikipedia.org10Templatecanonical0
dewiki_pde.wikipedia.org11Template talkcanonical0
dewiki_pde.wikipedia.org12Hilfeprimary1
dewiki_pde.wikipedia.org13Hilfe Diskussionprimary1
dewiki_pde.wikipedia.org12Helpcanonical0
dewiki_pde.wikipedia.org13Help talkcanonical0
dewiki_pde.wikipedia.org12Halias0
dewiki_pde.wikipedia.org13HDalias0
dewiki_pde.wikipedia.org14Kategorieprimary1
dewiki_pde.wikipedia.org15Kategorie Diskussionprimary1
dewiki_pde.wikipedia.org14Categorycanonical0
dewiki_pde.wikipedia.org15Category talkcanonical0
dewiki_pde.wikipedia.org100Portalcanonical1
dewiki_pde.wikipedia.org101Portal Diskussioncanonical1
dewiki_pde.wikipedia.org100Palias0
dewiki_pde.wikipedia.org101PDalias0
dewiki_pde.wikipedia.org828Modulprimary1
dewiki_pde.wikipedia.org829Modul Diskussionprimary1
dewiki_pde.wikipedia.org828Modulecanonical0
dewiki_pde.wikipedia.org829Module talkcanonical0

Like most things on meta_p, my own opinion is that this should go on production (and replicate to wikireplicas from there), maybe as part of handling better configuration management. It doesn't necessarily have to go into mysql, but it would be blocked by a better option than parsing configuration files.

In any case this is not a trivial thing to do and requires mediawiki experts input if done on production, or if there is already existing code, it would speed up its deployment (there is not non-public data preventing anyone from implementing this), current canonical data is on operations/mediawiki-config git repo.

jcrespo renamed this task from Added namespace IDs and names to meta_p to Include namespace IDs and its names to mysql wikireplicas (meta_p database).Nov 15 2017, 10:39 PM
jcrespo renamed this task from Include namespace IDs and its names to mysql wikireplicas (meta_p database) to Include namespace IDs and their names to mysql wikireplicas (meta_p database).
RobH removed a subscriber: RobH.Nov 15 2017, 10:40 PM

It's kind of funny that MediaWiki has gone out of its way to abstract namespace names, using namespace IDs so that the namespaces can be localized or renamed somewhat easily and specifically not putting the namespace names into the database. And this effort and architecture gets immediately undermined by having people insist that the namespace names be shoved back in to a database.

Given the small amount of data, the typically easy workarounds (e.g., using {{subst:ns:4}} when posting to a wiki page), and the availability of this data via api.php, I'm not sure it makes sense to continue maintaining this database. There might be some value if we resume using clusters (e.g., 1, 2, 3), as finding which databases were in each cluster was never programmatically exposed elsewhere, as far as I know.

The namespacename database table in particular is basically a cache of https://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces%7Cnamespacealiases, which most applications could simply look at themselves or, if needed for performance reasons, could create their own small cache of just the data they need instead of using a shared cache.

I didn't know that was already available on production as an api. If that is the case, I would either reject this or have it with the lowest priority because:

if needed for performance reasons, could create their own small cache of just the data they need instead of using a shared cache

Nosy added a comment.Nov 17 2017, 10:28 AM

If you like you can shutdown the project.
Can anyone see who queries the DB to inform the users and then turn it off after a reasonable amount of time?

bd808 moved this task from Backlog to Wiki replicas on the Data-Services board.Nov 28 2017, 4:51 AM
Tpt reopened this task as Open.Feb 28 2018, 6:19 PM
Tpt added a subscriber: Tpt.

Sorry, I merged tasks in the wrong direction