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)