Page MenuHomePhabricator

wfWikiId() as used by BagOStuff::makeKey() should include wgDBmwschema
Closed, ResolvedPublic

Description

$wgDBmwschema identifies the PG or MSSQL schema in the database. It's functionally equivalent to $wgDBprefix, in that it allows multiple wiki instances to co-exist in the same database. This means that wfWikiID() should include $wgDBmwschema if set for the same reason it includes $wgDBprefix: cache keys for different wikis in the same database need to be distinct.

Note that schema and prefix need to be encoded so wfSplitWikiID() can distinguish them.

Event Timeline

Krinkle renamed this task from wfWikiId should include wgDBmwschema. to wfWikiId() as used by BagOStuff::makeKey() should include wgDBmwschema.Jul 28 2018, 8:31 PM
Krinkle moved this task from General to libs/objectcache on the MediaWiki-libs-BagOStuff board.
Krinkle assigned this task to aaron.
Krinkle edited projects, added Performance-Team; removed MediaWiki-libs-Rdbms.
Krinkle subscribed.

Isn't that a duplicate of T17823 ?

That task is about changing the return value of wfWikiID.

This task is about changing the value of keyspace as used by ObjectCache. When this task was created, keyspace was set to wfWikiID() and changing the latter could have resolved it. However, that would be a breaking change and thus declined.

Instead, we have formalised the previously-internal concept of Database domain ID which includes the Pgsql schema string as well.

ObjectCache now uses this as of 42a6f991e0a8b / https://gerrit.wikimedia.org/r/467565.