Page MenuHomePhabricator

Replace LBFactory with injecting new Db-Service in Client's DirectSqlStore
Closed, ResolvedPublic

Description

This is a pretty big class that might benefit from some more refactoring first. It has a comment from 3 years ago that says:

// @TODO: split the class so it needs less injection

And, on a related note, LBFactory is currently not injected but created in multiple places via

$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); // TODO inject

and then used with

$lbFactory->getMainLB( $this->repoWiki ),

to create the SessionConsistentConnectionManager, SiteLinkLookup, and EntityChangeLookup.

Event Timeline

Hm. I think this class needs two DomainDbs injected, one for the repo and one for the client? (Is that one RepoDomainDb and one ClientDomainDb, or two ClientDomainDb? It’s not clear to me what the difference between these classes is.)

At least, it has methods getRepoConnectionManager() and getLocalConnectionManager(), which seem to correspond directly to DomainDb::sessionConsistentConnections().

Change 699072 had a related patch set uploaded (by Ladsgroup; author: Ladsgroup):

[mediawiki/extensions/Wikibase@master] Migrate SiteLinkTable to use RepoDomainDb

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

Change 699074 had a related patch set uploaded (by Ladsgroup; author: Ladsgroup):

[mediawiki/extensions/Wikibase@master] Use RepoDomainDb in EntityChangeLookup

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

Change 699072 abandoned by Ladsgroup:

[mediawiki/extensions/Wikibase@master] Migrate SiteLinkTable to use RepoDomainDb

Reason:

Done in I3d6e69bb92fa3c1607e3eb70625346949b4fbd73

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

Change 699397 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Inject RepoDomainDb into client DirectSqlStore

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

Change 699074 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Use RepoDomainDb in EntityChangeLookup

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

Change 699397 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Inject RepoDomainDb into client DirectSqlStore

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