Page MenuHomePhabricator

Replace ILBFactory by injecting new Db-Service in Repo's PropertyInfoTableBuilder
Closed, ResolvedPublic

Description

This class already gets a DB connection from PropertyInfoTable but then still gets an LBFactory to be able to wait for replication. That seems a strange way to go about it and could probably use some more refactoring.

PropertyInfoTableBuilder.php
$dbw = $this->propertyInfoTable->getWriteConnection();
PropertyInfoTableBuilder.php
// @TODO: Inject the LBFactory
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
PropertyInfoTableBuilder.php
// Make sure we are not running too far ahead of the replicas,
// as that would cause the site to be rendered read only.
$lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );

Also, it seems that the private field $entityIdComposer is unused? That should be double-checked and cleaned up if true.

Event Timeline

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

[mediawiki/extensions/Wikibase@master] Remove EntityIdComposer from PropertyInfoTableBuilder

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

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

[mediawiki/extensions/Wikibase@master] Remove useTransactions flag from PropertyInfoTableBuilder

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

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

[mediawiki/extensions/Wikibase@master] Make PropertyInfoTableBuilder get DomainDb from PropertyInfoTable

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

Change 700650 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Remove EntityIdComposer from PropertyInfoTableBuilder

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

Change 700651 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Remove useTransactions flag from PropertyInfoTableBuilder

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

Change 700652 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Make PropertyInfoTableBuilder get DomainDb from PropertyInfoTable

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