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.