Page MenuHomePhabricator

Reduce WANObjectCache configurability
Closed, ResolvedPublic

Description

Motivation

  • Reduce the number of things you have to "get right" as a MediaWiki sysadmin.
  • Reduce the number of things you have to know about and/or debug as a MediaWiki developer.
  • Reduce the number of things Perf Team have to support, as maintainer of the BagOStuff library.
  • Improve performance and reliability by re-using the same underlying Memcached connection when possible.

Background

The $wgMainWANCache and $wgWANObjectCaches configurability was introduced as part of the original 2015 Mult-DC plan. The expectation was that in order to faccilitate broadcasting of purges/tombstones, there'd be a "main" one and another one to send purges to. The actual implementation ended up quite different and so this infrastructure was never used.

It has always been required in terms of actual storage, that WANCache wrap the "local cluster cache". In terms of implementation, it was thought as part of the original 2015 Multi-DC plan that perhaps the purge broadcasts (for Multi-DC compliance) would use a different protocol or service besides Memcached. In the end, we ended up requiring that from MediaWiki's point of view these relays always speak the Memcached protocol. E.g. MediaWiki supports Mcrouter, Dynomite, Nutcracker, etc. but each of these it is a transparent proxy to the main cache cluster with some side-effect. It doesn't require configuring a different BagOStuff, and the same proxy can be used for the non-WANCache keys as well.

https://www.mediawiki.org/wiki/Requests_for_comment/Multi_datacenter_strategy_for_MediaWiki
https://wikitech.wikimedia.org/wiki/Performance/Multi-DC_MediaWiki

Work

  • Remove $wgMainWANCache and $wgWANObjectCaches, in favour of $wgMainCacheType.
  • Make the "local cluster cache" object owned by service wiring instead of ObjectCache.php.
  • Re-use this in the MainWANObjectCache service.
  • Update relevant sysadmin docs in MainConfigSchema.php and on mediawiki.org.

Event Timeline

Change 889229 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] ObjectCache: Make newFromParams() more suitable for internal re-use

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

Change 889243 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] objectcache: Move main cache to internal "_LocalClusterCache" service

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

Change 889245 had a related patch set uploaded (by Krinkle; author: Krinkle):

[operations/mediawiki-config@master] mc: Add new $wgWANObjectCache setting

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

Change 889244 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] objectcache: Remove $wgMainWANCache and $wgWANObjectCaches

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

Change 889246 had a related patch set uploaded (by Krinkle; author: Krinkle):

[operations/mediawiki-config@master] mc: Remove unused $wgWANObjectCaches and $wgMainWANCache

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

Krinkle triaged this task as Medium priority.Feb 14 2023, 11:58 PM

Change 889229 merged by jenkins-bot:

[mediawiki/core@master] ObjectCache: Make newFromParams() more suitable for internal re-use

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

Change 889243 merged by jenkins-bot:

[mediawiki/core@master] objectcache: Move main cache to internal "_LocalClusterCache" service

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

Change 889245 merged by jenkins-bot:

[operations/mediawiki-config@master] mc: Add new $wgWANObjectCache setting

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

Change 889244 merged by jenkins-bot:

[mediawiki/core@master] objectcache: Remove $wgMainWANCache and $wgWANObjectCaches

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

@Tgr The change is known and anticipated. I described it in the above commit, and updated two affected extensions ahead of that change which had a would-be-failing test that relied on WANCache being disabled.

It seems unlikely many tests rely on this, but in case others run into it, I've summarised it on Wikitech-l just now so that others at least know about the 1-line fix right away if they encounter it. The failure will be deterministic and locally reproducible.

Krinkle renamed this task from Remove WANObjectCache configurability to Reduce WANObjectCache configurability.Mar 28 2023, 1:43 AM

Change 889246 merged by jenkins-bot:

[operations/mediawiki-config@master] mc: Remove unused $wgWANObjectCaches and $wgMainWANCache

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

Change 912421 had a related patch set uploaded (by Krinkle; author: Krinkle):

[operations/mediawiki-config@master] mc: Fix accidental mcrouter prefix $wgWANObjectCache on labswiki

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

Change 912421 merged by jenkins-bot:

[operations/mediawiki-config@master] mc: Fix accidental mcrouter prefix $wgWANObjectCache on labswiki

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

Change #1129973 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] objectcache: Rename "MainWANObjectCache" to "WANObjectCache"

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