Revert "rdbms: add domain sanity checks to LoadBalancer connection methods"
This reverts commit b416e166a3.
Fails on Travis CI / PHP 7.1 / Postgres:
> Creating administrator user account
>
> UnexpectedValueException:
> Got connection to 'traviswiki-mediawiki', but expected 'traviswiki'.
>
> Backtrace:
> #0 includes/libs/rdbms/loadbalancer/LoadBalancer.php(887): Wikimedia\Rdbms\LoadBalancer->openForeignConnection(integer, string, integer)
> #1 includes/libs/rdbms/loadbalancer/LoadBalancer.php(766): Wikimedia\Rdbms\LoadBalancer->openConnection(integer, string, integer)
> #2 includes/libs/rdbms/loadbalancer/LoadBalancer.php(851): Wikimedia\Rdbms\LoadBalancer->getConnection(integer, array, string, integer)
> #3 includes/jobqueue/JobQueueDB.php(780): Wikimedia\Rdbms\LoadBalancer->getConnectionRef(integer, array, string, integer)
> #4 includes/jobqueue/JobQueueDB.php(761): JobQueueDB->getDB(integer)
> #5 includes/jobqueue/JobQueueDB.php(187): JobQueueDB->getMasterDB()
> #6 includes/jobqueue/JobQueue.php(332): JobQueueDB->doBatchPush(array, integer)
> #7 includes/jobqueue/JobQueue.php(302): JobQueue->batchPush(array, integer)
> #8 includes/jobqueue/JobQueueGroup.php(154): JobQueue->push(array)
> #9 includes/user/UserGroupMembership.php(162): JobQueueGroup->push(array)
> #10 includes/user/User.php(3733): UserGroupMembership->insert(boolean)
> #11 includes/installer/Installer.php(1680): User->addGroup(string)
> #12 includes/installer/Installer.php(1601): Installer->createSysop(PostgresInstaller)
> #13 includes/installer/CliInstaller.php(176): Installer->performInstallation(array, array)
Change-Id: I269df89d47cc5a183af630447cd1642d3d4a3deb
This commit is contained in:
parent
b416e166a3
commit
f23ac02f4f
1 changed files with 1 additions and 18 deletions
|
|
@ -28,7 +28,6 @@ use BagOStuff;
|
|||
use EmptyBagOStuff;
|
||||
use WANObjectCache;
|
||||
use ArrayUtils;
|
||||
use UnexpectedValueException;
|
||||
use InvalidArgumentException;
|
||||
use RuntimeException;
|
||||
use Exception;
|
||||
|
|
@ -953,17 +952,6 @@ class LoadBalancer implements ILoadBalancer {
|
|||
}
|
||||
}
|
||||
|
||||
// Final sanity check to make sure the right domain is selected
|
||||
if (
|
||||
$conn instanceof IDatabase &&
|
||||
$this->localDomain->getDatabase() !== null &&
|
||||
$conn->getDomainID() !== $this->localDomain->getId()
|
||||
) {
|
||||
throw new UnexpectedValueException(
|
||||
"Got connection to '{$conn->getDomainID()}', " .
|
||||
"but expected local domain ('{$this->localDomain}')." );
|
||||
}
|
||||
|
||||
return $conn;
|
||||
}
|
||||
|
||||
|
|
@ -1050,13 +1038,8 @@ class LoadBalancer implements ILoadBalancer {
|
|||
}
|
||||
}
|
||||
|
||||
// Increment reference count
|
||||
if ( $conn instanceof IDatabase ) {
|
||||
// Final sanity check to make sure the right domain is selected
|
||||
if ( $domainInstance->getDatabase() !== null && $conn->getDomainID() !== $domain ) {
|
||||
throw new UnexpectedValueException(
|
||||
"Got connection to '{$conn->getDomainID()}', but expected '$domain'." );
|
||||
}
|
||||
// Increment reference count
|
||||
$refCount = $conn->getLBInfo( 'foreignPoolRefCount' );
|
||||
$conn->setLBInfo( 'foreignPoolRefCount', $refCount + 1 );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue