Page MenuHomePhabricator

Make storage for old revision parser cache configurable
Closed, ResolvedPublic

Description

We need to make the storage medium for old revision ParserCache configurable, something like $wgOldRevisionParserCacheType, analogues to $wgParserCacheType. This will allow us to utilize local memcached fallback for old revisions (see T244340)

Event Timeline

Change 643599 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Add $wgOldRevisionParserCacheType

https://gerrit.wikimedia.org/r/643599

Change 643600 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[operations/mediawiki-config@master] Add wgOldRevisionParserCacheType setting

https://gerrit.wikimedia.org/r/643600

Change 643599 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Add $wgOldRevisionParserCacheType

https://gerrit.wikimedia.org/r/643599

- 			ObjectCache::getLocalClusterInstance(),
+ 			ObjectCache::getInstance( $config->get( 'OldRevisionParserCacheType' ) ),

I think a simpler solution here might be to use WANObjectCache. I don't see anything about this feature that would require a new top-level configurable backend to be added. Doing so would add long-term complexity and means site admins have yet another config switch to worry about and ensure to set correctly. See Manual:Caching for more details, but in general I've been trying to reduce these in favour of more well-documented primitives that sites can tune and configure as-needed.

LocalCluster was possibly not a good choice so it's good that we're changing this. That one is mostly for internal use and should rarely be used anywhere in "regular" code, and is indeed compatible with mediawiki-on-host at WMF. WANObjectCache on the other hand is the de-facto default way to use Memcached in MW and will (eventually) be switched over mediawiki-on-host.

If it's important that "old revision" use mediawiki-on-host at WMF "now" ASAP, then perhaps this can be marked as experimental/deprecated config just for the 1.36 release cycle internally, e.g. set to false by default, which it would interpret as using getMainWANObjectCache() instead.

Change 644251 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] PoolWorkArticleViewOld: use WANObjectCache

https://gerrit.wikimedia.org/r/644251

Change 643600 abandoned by Ppchelko:
[operations/mediawiki-config@master] Add wgOldRevisionParserCacheType setting

Reason:
Ic16feffecaf4b75c284c6ef34de42ac113e625f8

https://gerrit.wikimedia.org/r/643600

Change 643599 abandoned by Ppchelko:
[mediawiki/core@master] Add $wgOldRevisionParserCacheType

Reason:
Ic16feffecaf4b75c284c6ef34de42ac113e625f8

https://gerrit.wikimedia.org/r/643599

Went with WANObjectCache. There's no requirement to use on host memcached sooner then the rest of MW does.

Change 644251 merged by jenkins-bot:
[mediawiki/core@master] PoolWorkArticleViewOld: use WANObjectCache

https://gerrit.wikimedia.org/r/644251