Page MenuHomePhabricator

Migrate ContentTranslation to use a virtual database domain
Closed, ResolvedPublic8 Estimated Story Points

Event Timeline

Change #1152065 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[operations/mediawiki-config@master] CX: Add virtual-cx-shared DatabaseVirtualDomains

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

Change #1152068 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/ContentTranslation@master] Introduce usage of DatabaseVirtualDomains

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

I see two configuration options in ContentTranslation extension,

'wgContentTranslationDatabase' => [
	'default' => 'wikishared',
	'testwiki' => 'testwiki',
],
'wmgContentTranslationCluster' => [
	'default' => 'extension1',
	'testwiki' => false,
],

In ContentTranslation\LoadBalancer::getConnection, we have,

$lb = $this->contentTranslationCluster
			? $this->lbFactory->getExternalLB( $this->contentTranslationCluster )
			: $this->lbFactory->getMainLB( $this->contentTranslationDatabase );

return $lb->getConnection( $type, $group, $this->contentTranslationDatabase );

I'm planning to add two methods to get the primary database, and the replica database using the IConnectionProvider class.

abi_ set the point value for this task to 4.

Change #1152252 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/ContentTranslation@master] Replace usage of LoadBalancer::getConnection with virtual domain

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

Change #1153136 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/ContentTranslation@master] Replace LoadBalancer with ConnectionProvider

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

Change #1156376 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/ContentTranslation@master] SchemaHooks: Drop schema changes for MW <= 1.35

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

abi_ changed the point value for this task from 4 to 8.Jun 13 2025, 8:45 AM

Updating SP to reflect the work involved.

Change #1156769 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/ContentTranslation@master] SchemaHooks: Use addExtensionUpdateOnVirtualDomain method

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

Change #1159761 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/ContentTranslation@master] Remove unused cluster and database configurations

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

Change #1152068 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Introduce usage of DatabaseVirtualDomains

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

Change #1152252 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Replace usage of LoadBalancer::getConnection with virtual domain

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

Change #1161788 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/ContentTranslation@master] Remove unnecessary wait for database replication calls

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

Change #1153136 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Replace LoadBalancer with ConnectionProvider

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

Change #1156376 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SchemaHooks: Drop schema changes for MW <= 1.35

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

I've tested the latest changes on testwiki and I'm able to publish translations using CX successfully. I see an unrelated issue with the mobile editor:

image.png (720×616 px, 90 KB)

I tested the changes with CX on Hebrew Wikipedia. Saving translations works as expected, and I was able to publish to my namespace.

We can proceed with merging the next set of patches.

FWIW, We've dropped support for upgrades from 1.36 and 1.37 if you want to clean those up too!

Change #1156769 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SchemaHooks: Use addExtensionUpdateOnVirtualDomain method

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

Change #1165854 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/vagrant@master] CX: Use VirtualDomainMapping

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

Change #1165854 merged by jenkins-bot:

[mediawiki/vagrant@master] CX: Use VirtualDomainMapping

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

Change #1152065 merged by jenkins-bot:

[operations/mediawiki-config@master] CX: Add virtual-cx-shared DatabaseVirtualDomains

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

Mentioned in SAL (#wikimedia-operations) [2025-07-09T07:05:58Z] <kartik@deploy1003> Started scap sync-world: Backport for [[gerrit:1152065|CX: Add virtual-cx-shared DatabaseVirtualDomains (T348513)]]

Mentioned in SAL (#wikimedia-operations) [2025-07-09T07:08:08Z] <kartik@deploy1003> kartik, abi: Backport for [[gerrit:1152065|CX: Add virtual-cx-shared DatabaseVirtualDomains (T348513)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-07-09T07:31:19Z] <kartik@deploy1003> Finished scap sync-world: Backport for [[gerrit:1152065|CX: Add virtual-cx-shared DatabaseVirtualDomains (T348513)]] (duration: 25m 21s)

Change #1159761 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Remove unused cluster and database configurations

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

Change #1168757 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[operations/mediawiki-config@master] CX: Remove unused config related to database and cluster

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

Change #1168757 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[operations/mediawiki-config@master] CX: Remove unused config related to database and cluster

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

To be deployed on production

Change #1168757 merged by jenkins-bot:

[operations/mediawiki-config@master] CX: Remove unused config related to database and cluster

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

Mentioned in SAL (#wikimedia-operations) [2025-07-17T07:45:00Z] <gkyziridis@deploy1003> Started scap sync-world: Backport for [[gerrit:1168757|CX: Remove unused config related to database and cluster (T348513)]]

Mentioned in SAL (#wikimedia-operations) [2025-07-17T07:47:19Z] <gkyziridis@deploy1003> gkyziridis, abi: Backport for [[gerrit:1168757|CX: Remove unused config related to database and cluster (T348513)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-07-17T08:07:15Z] <gkyziridis@deploy1003> Finished scap sync-world: Backport for [[gerrit:1168757|CX: Remove unused config related to database and cluster (T348513)]] (duration: 22m 15s)

abi_ moved this task from Pending Deployment to Done on the LPL Essential (2025 Jul-Oct) board.

All changes are deployed.

We started using a virtual domain:

$wgVirtualDomainsMapping['virtual-cx'] = [
	'cluster' => 'extension1',
	'db' => 'wikishared',
];

Two old configuration options were dropped:

  • wgContentTranslationCluster
  • wgContentTranslationDatabase