HomePhabricator

rdbms: specify DB name and table prefix even for the local domain
14ee3f210782Unpublished

Authored by aaron on Jan 12 2018, 9:44 PM.

Unpublished Commit · Learn More

Publishing Disabled: All publishing is disabled for this repository.

Description

rdbms: specify DB name and table prefix even for the local domain

When LoadBalancer opens new local domain connections, it currently
assumes that the domain specified by the server info array is the
same. For sanity, make sure that the handle is set to the local
domain.

The main LBFactory/LoadBalancer use $wgDBname/$wgDBprefix as the
local domain, corresponding with wfWikiId(). This relation is set
automatically in MWLBFactory. If $wgLBFactoryConf/$wgDBservers is
manually configured in a way breaking this correspondance, then it
is misconfigured.

Fixes made to avoid test failure:

  • Make sure LoadBalancer::setDomainPrefix() updates the local domain alias member. Also do not bother changing the domain of foreign connections.
  • Use the right domain ID for the connection array key names in LoadBalancer::openForeignConnection().
  • Now that JobQueueTest no longer mistakenly uses the non-test tables, force it to use the main DB_MASTER handle so that it can see the unit test tables even if they are TEMPORARY; such tables are tied to the TCP connection, so separate handles see different temporary tables.

Change-Id: I56f8b32fe957f984b8c9753e6db3b20abe96b038

Details

Committed
aaronJan 16 2018, 5:06 PM
Parents
rMW79d298e37f8a: Merge "Clear the backlink cache on file delete"
Branches
Unknown
Tags
Unknown
References
refs/changes/56/404056/9
ChangeId
I56f8b32fe957f984b8c9753e6db3b20abe96b038