Page MenuHomePhabricator

[COG] [TECH] Migrate Cognate to use a virtual database domain
Closed, ResolvedPublic

Description

See T330590: External LBs should not be exposed to developers for context, and this UrlShortener change for an example of the change to implement.

Should be a fairly small change, I expect – the DB setup is already well centralized in this extension, only two places call getExternalLB: the service wiring, and the database updater (where the service wiring isn’t available yet).

Event Timeline

Task Review Notes:

  • The scope is relatively limited, and it might help improve readability.

Prio Notes:

  • Does not affect end users / production
  • Does not affect monitoring
  • Affects development efforts
  • Does not affect onboarding
  • Might affect additional stakeholders (DBA intend to eventualy deprecate the old style)
ItamarWMDE renamed this task from Migrate Cognate to use a virtual database domain to [SW] [COGNATE] [TECH] Migrate Cognate to use a virtual database domain.Oct 10 2023, 1:44 PM
ItamarWMDE moved this task from Incoming to [DOT] Prioritized on the wmde-wikidata-tech board.
ItamarWMDE renamed this task from [SW] [COGNATE] [TECH] Migrate Cognate to use a virtual database domain to [SW] [COG] [TECH] Migrate Cognate to use a virtual database domain.Oct 10 2023, 5:00 PM
ItamarWMDE renamed this task from [SW] [COG] [TECH] Migrate Cognate to use a virtual database domain to [COG] [TECH] Migrate Cognate to use a virtual database domain.Oct 25 2023, 9:07 AM

Change 994922 had a related patch set uploaded (by Hoo man; author: Hoo man):

[operations/mediawiki-config@master] Add wgVirtualDomainsMapping for Cognate

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

Change 994922 merged by jenkins-bot:

[operations/mediawiki-config@master] Add wgVirtualDomainsMapping for Cognate

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

Mentioned in SAL (#wikimedia-operations) [2024-02-06T08:08:46Z] <hoo@deploy2002> Started scap: Backport for [[gerrit:994922|Add wgVirtualDomainsMapping for Cognate (T348526)]]

Mentioned in SAL (#wikimedia-operations) [2024-02-06T08:10:35Z] <hoo@deploy2002> hoo: Backport for [[gerrit:994922|Add wgVirtualDomainsMapping for Cognate (T348526)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-02-06T08:17:38Z] <hoo@deploy2002> Finished scap: Backport for [[gerrit:994922|Add wgVirtualDomainsMapping for Cognate (T348526)]] (duration: 08m 51s)

Change 1003510 had a related patch set uploaded (by Hoo man; author: Hoo man):

[mediawiki/extensions/Cognate@master] Migrate to virtual domain mapping

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

Change 1003510 merged by jenkins-bot:

[mediawiki/extensions/Cognate@master] Migrate to virtual domain mapping

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

Change 1005467 had a related patch set uploaded (by Hoo man; author: Hoo man):

[mediawiki/extensions/Cognate@wmf/1.42.0-wmf.18] Migrate to virtual domain mapping

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

Change 1005485 had a related patch set uploaded (by Hoo man; author: Hoo man):

[mediawiki/extensions/Cognate@wmf/1.42.0-wmf.19] Migrate to virtual domain mapping

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

Change 1005467 merged by jenkins-bot:

[mediawiki/extensions/Cognate@wmf/1.42.0-wmf.18] Migrate to virtual domain mapping

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

Change 1005485 merged by jenkins-bot:

[mediawiki/extensions/Cognate@wmf/1.42.0-wmf.19] Migrate to virtual domain mapping

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

Mentioned in SAL (#wikimedia-operations) [2024-02-22T08:06:30Z] <hoo@deploy2002> Started scap: Backport for [[gerrit:1005467|Migrate to virtual domain mapping (T348526)]], [[gerrit:1005485|Migrate to virtual domain mapping (T348526)]]

Mentioned in SAL (#wikimedia-operations) [2024-02-22T08:08:04Z] <hoo@deploy2002> hoo: Backport for [[gerrit:1005467|Migrate to virtual domain mapping (T348526)]], [[gerrit:1005485|Migrate to virtual domain mapping (T348526)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-02-22T08:21:15Z] <hoo@deploy2002> Finished scap: Backport for [[gerrit:1005467|Migrate to virtual domain mapping (T348526)]], [[gerrit:1005485|Migrate to virtual domain mapping (T348526)]] (duration: 14m 44s)

Change 1005725 had a related patch set uploaded (by Hoo man; author: Hoo man):

[mediawiki/extensions/Cognate@master] Introduce a constant for the virtual domain name

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

Change 1005725 merged by jenkins-bot:

[mediawiki/extensions/Cognate@master] Introduce a constant for the virtual domain name

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

Hi hi. You still need to change the db updater hook

That’s too terse for me to understand, sorry – can you clarify what’s still missing? (Move CognateUpdater logic into CognateSchemaHooks was merged, but I also thought that was just an optional refactoring.)

Oh then it's done. I missed it because it wasn't connected to this ticket. My bad!

Could you explain what still needs to be done here, maybe some cleanup? The current config has a "temp"-comment linking to this task:

wmf-config/InitialiseSettings.php
if ( $wmgUseCognate ) {
	wfLoadExtension( 'Cognate' );
	$wgVirtualDomainsMapping['virtual-cognate'] = [ 'cluster' => 'extension1', 'db' => 'cognate_wiktionary' ];
	$wgCognateNamespaces = [ 0 ];
	// Temp b/c for T348526
	$wgCognateDb = 'cognate_' . $wmgUseCognate;
	$wgCognateCluster = 'extension1';
}

I noticed this because we have two tasks about Cognate not fully working for new Wiktionaries (T326432 and T360194). They are probably not directly related, but this config is not helping with figuring out the root cause.

Change #1026982 had a related patch set uploaded (by Hoo man; author: Hoo man):

[operations/mediawiki-config@master] Remove Cognate virtual domain mapping b/c code

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