'LinksUpdateComplete': At the end of LinksUpdate::doUpdate() when updating,
including delete and insert, has completed for all link tables
&$linksUpdate: the LinksUpdate object
+$ticket: prior result of LBFactory::getEmptyTransactionTicket()
'LinksUpdateConstructed': At the end of LinksUpdate() is construction.
&$linksUpdate: the LinksUpdate object
// Run post-commit hooks without DBO_TRX
$this->getDB()->onTransactionIdle(
function () {
- Hooks::run( 'LinksUpdateComplete', [ &$this ] );
+ Hooks::run( 'LinksUpdateComplete', [ &$this, $this->ticket ] );
},
__METHOD__
);
* Gets master database connections for all of the ExternalStoreDB
* stores configured in $wgDefaultExternalStore.
*
- * @return array Array of DatabaseBase master connections
+ * @return DatabaseBase[] Array of DatabaseBase master connections
*/
protected static function getExternalStoreDatabaseConnections() {
global $wgDefaultExternalStore;
+ /** @var ExternalStoreDB $externalStoreDB */
$externalStoreDB = ExternalStore::getStoreObject( 'DB' );
$defaultArray = (array) $wgDefaultExternalStore;
$dbws = [];
foreach ( $defaultArray as $url ) {
if ( strpos( $url, 'DB://' ) === 0 ) {
list( $proto, $cluster ) = explode( '://', $url, 2 );
- $dbw = $externalStoreDB->getMaster( $cluster );
+ // Avoid getMaster() because setupDatabaseWithTestPrefix()
+ // requires DatabaseBase instead of plain DBConnRef/IDatabase
+ $lb = $externalStoreDB->getLoadBalancer( $cluster );
+ $dbw = $lb->getConnection( DB_MASTER );
$dbws[] = $dbw;
}
}