diff options
author | Aaron Schulz <aschulz@wikimedia.org> | 2018-10-13 00:29:23 -0700 |
---|---|---|
committer | Krinkle <krinklemail@gmail.com> | 2018-11-07 04:46:56 +0000 |
commit | 51945dbca35944567480b6e6494c7c2fa0c75797 (patch) | |
tree | 232fbf9c0e27dbef83c24d360c382fab65ba54d9 /tests/phpunit/includes/jobqueue/JobQueueTest.php | |
parent | d917159e0d638dbc3bcbd7e2e733c43af629d1bc (diff) | |
download | mediawikicore-51945dbca35944567480b6e6494c7c2fa0c75797.tar.gz mediawikicore-51945dbca35944567480b6e6494c7c2fa0c75797.zip |
Use DB domain in JobQueueGroup and make WikiMap domain ID methods stricter
Using domains means thats JobQueueDB has the right value to use for calls
like LoadBalancer::getConnection(). The full domain includes the schema in
the case of Postgres. This makes calls to getConnection() less awkward by
not relying on the fallback logic in reallyOpenConnection() for null schemas.
Make getWikiIdFromDomain/isCurrentWikiDomain account for the schema if it
is both defined and is not simply the generic "mediawiki" schema MediaWiki
uses by default. If all wikis use the default schema, the wiki IDs can get
by with DB/prefix alone, which various config and methods may be built around.
Otherwise, the config callbacks must account for schema and the config must
include it in various wiki domain ID lists to properly disambiguate wikis.
Also, clean up SiteConfiguration::siteFromDB() since it is not meant
to handle schemas unless the callback method was taylored to do so.
Finally, add more comments to DefaultSettings.php about already existing
limitations of wiki domain IDs and their components.
Change-Id: I8d94a650e5c99a19ee50551c5be9544318eb05b1
Diffstat (limited to 'tests/phpunit/includes/jobqueue/JobQueueTest.php')
-rw-r--r-- | tests/phpunit/includes/jobqueue/JobQueueTest.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/phpunit/includes/jobqueue/JobQueueTest.php b/tests/phpunit/includes/jobqueue/JobQueueTest.php index 64dde778185f..0421fe7c68d2 100644 --- a/tests/phpunit/includes/jobqueue/JobQueueTest.php +++ b/tests/phpunit/includes/jobqueue/JobQueueTest.php @@ -75,6 +75,7 @@ class JobQueueTest extends MediaWikiTestCase { $this->markTestSkipped( $desc ); } $this->assertEquals( wfWikiID(), $queue->getWiki(), "Proper wiki ID ($desc)" ); + $this->assertEquals( wfWikiID(), $queue->getDomain(), "Proper wiki ID ($desc)" ); } /** @@ -388,6 +389,6 @@ class JobQueueDBSingle extends JobQueueDB { protected function getDB( $index ) { $lb = MediaWikiServices::getInstance()->getDBLoadBalancer(); // Override to not use CONN_TRX_AUTOCOMMIT so that we see the same temporary `job` table - return $lb->getConnection( $index, [], $this->wiki ); + return $lb->getConnection( $index, [], $this->domain ); } } |