Page MenuHomePhabricator

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

Description

This class could also benefit from some refactoring as it doesn't seem to be well scoped or named. In particular, its name would imply that it is build by EntityUsageTableBuilder but those classes seem to have only little to do with each other.

EntityUsageTable already gets an IDatabase connection injected but also creates an ILBFactory and read-connection itself with:

//TODO: Inject
$this->loadBalancerFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$this->readConnection = $this->loadBalancerFactory->getMainLB()->getConnection( DB_REPLICA );

and uses that also for waiting for replication:

// Wait for all database replicas to be updated, but only for the affected client wiki. The
// "domain" argument is documented at ILBFactory::waitForReplication.
$this->loadBalancerFactory->waitForReplication( [ 'domain' => wfWikiID() ] );

(wfWikiID() is deprecated)

Event Timeline

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

[mediawiki/extensions/Wikibase@master] client: Use ClientDomainDb in EntityUsageTable

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

Change 699054 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] client: Use ClientDomainDb in EntityUsageTable

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

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

[mediawiki/extensions/Wikibase@master] client: Use ClientDomainDb in DirectSqlStore

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

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

[mediawiki/extensions/Wikibase@master] client: Use ClientDomainDb in DirectSqlStore

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

Change 700667 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] client: Use ClientDomainDb in DirectSqlStore

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