Use DB domain in JobQueueGroup and make WikiMap domain ID methods stricter
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 13 Oct 2018 07:29:23 +0000 (00:29 -0700)
committerKrinkle <krinklemail@gmail.com>
Wed, 7 Nov 2018 04:46:56 +0000 (04:46 +0000)
commit51945dbca35944567480b6e6494c7c2fa0c75797
tree232fbf9c0e27dbef83c24d360c382fab65ba54d9
parentd917159e0d638dbc3bcbd7e2e733c43af629d1bc
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
14 files changed:
includes/DefaultSettings.php
includes/SiteConfiguration.php
includes/WikiMap.php
includes/installer/i18n/en.json
includes/jobqueue/JobQueue.php
includes/jobqueue/JobQueueDB.php
includes/jobqueue/JobQueueFederated.php
includes/jobqueue/JobQueueGroup.php
includes/jobqueue/JobQueueMemory.php
includes/jobqueue/JobQueueRedis.php
includes/jobqueue/aggregator/JobQueueAggregator.php
maintenance/manageJobs.php
tests/phpunit/includes/WikiMapTest.php
tests/phpunit/includes/jobqueue/JobQueueTest.php