Page MenuHomePhabricator

Replace ILBFactory by using the new Db-Service in Repo's dispatchChanges maint. script and classes SqlChangeDispatchCoordinator and LockManagerSqlChangeDispatchCoordinator
Closed, ResolvedPublic

Description

LockManagerSqlChangeDispatchCoordinator is only using it in its parent constructor, and the usage in SqlChangeDispatchCoordinator seems pretty straight forward as well:

SqlChangeDispatchCoordinator
	/**
	 * @return ILoadBalancer the repo's database load balancer.
	 */
	private function getRepoLB(): ILoadBalancer {
		return $this->LBFactory->getMainLB( $this->repoDB );
	}

	/**
	 * @return IDatabase A connection to the repo's master database
	 */
	private function getRepoMaster(): IDatabase {
		return $this->getRepoLB()->getConnectionRef( DB_PRIMARY, [], $this->repoDB );
	}

	/**
	 * @return IDatabase A connection to the repo's replica database
	 */
	private function getRepoReplica(): IDatabase {
		return $this->getRepoLB()->getConnectionRef( DB_REPLICA, [], $this->repoDB );
	}
SqlChangeDispatchCoordinator
$this->LBFactory->waitForReplication( [ 'domain' => $this->repoDB ] );

Event Timeline

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

[mediawiki/extensions/Wikibase@master] Use RepoDomainDb in dispatching code

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

Change 700962 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Use RepoDomainDb in dispatching code

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