From: Timo Tijhof Date: Mon, 20 May 2019 23:02:47 +0000 (+0100) Subject: resourceloader: Make MessageBlobStore global check key actually global X-Git-Tag: 1.34.0-rc.0~1621^2 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=ed06b683730ff46892a4a3835e54165dc8a999bd;p=lhc%2Fweb%2Fwiklou.git resourceloader: Make MessageBlobStore global check key actually global Because it was still per-wiki, which isn't useful and makes it really slow to invalidate by requiring a 900-wiki iteration during deployments all of which fully initialise MW just to send a single Memcached command basically. Bug: T222539 Change-Id: I02a3e7d83172ccd7d8d0fba3be1e3f1ebb77efb2 --- diff --git a/includes/resourceloader/MessageBlobStore.php b/includes/resourceloader/MessageBlobStore.php index 635e4337d8..74d0616d1d 100644 --- a/includes/resourceloader/MessageBlobStore.php +++ b/includes/resourceloader/MessageBlobStore.php @@ -96,7 +96,7 @@ class MessageBlobStore implements LoggerAwareInterface { $cache = $this->wanCache; $checkKeys = [ // Global check key, see clear() - $cache->makeKey( __CLASS__ ) + $cache->makeGlobalKey( __CLASS__ ) ]; $cacheKeys = []; foreach ( $modules as $name => $module ) { @@ -173,9 +173,14 @@ class MessageBlobStore implements LoggerAwareInterface { */ public function clear() { $cache = $this->wanCache; - // Disable holdoff because this invalidates all modules and also not needed since - // LocalisationCache is stored outside the database and doesn't have lag. - $cache->touchCheckKey( $cache->makeKey( __CLASS__ ), $cache::HOLDOFF_NONE ); + // Disable hold-off because: + // - LocalisationCache is populated by messages on-disk and don't have DB lag, + // thus there is no need for hold off. We only clear it after new localisation + // updates are known to be deployed to all servers. + // - This global check key invalidates message blobs for all modules for all wikis + // in cache contexts (e.g. languages, skins). Setting a hold-off on this key could + // cause a cache stampede since no values would be stored for several seconds. + $cache->touchCheckKey( $cache->makeGlobalKey( __CLASS__ ), $cache::HOLDOFF_NONE ); } /**