From: Aaron Schulz Date: Thu, 17 Aug 2017 03:13:35 +0000 (-0700) Subject: Use the main stash for LBFactory "memStash" parameter X-Git-Tag: 1.31.0-rc.0~1559 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=5547e66d28669e94ef042ad3e464e6baec79e0e3;p=lhc%2Fweb%2Fwiklou.git Use the main stash for LBFactory "memStash" parameter This store is used for ChronologyProtector positions. It should be cross-DC since the sticky DC cookie may not work for rapid cross-wiki farm activity, causing some request go to the non-primary DC. NOTE: this change should be deployed on all farm wikis at once Change-Id: Ife126592aacace696e43912b9461164a9ea98bc1 --- diff --git a/includes/db/MWLBFactory.php b/includes/db/MWLBFactory.php index 5196ac2d64..aa1918d51f 100644 --- a/includes/db/MWLBFactory.php +++ b/includes/db/MWLBFactory.php @@ -142,16 +142,18 @@ abstract class MWLBFactory { } } + $services = MediaWikiServices::getInstance(); + // Use APC/memcached style caching, but avoids loops with CACHE_DB (T141804) - $sCache = MediaWikiServices::getInstance()->getLocalServerObjectCache(); + $sCache = $services->getLocalServerObjectCache(); if ( $sCache->getQoS( $sCache::ATTR_EMULATION ) > $sCache::QOS_EMULATION_SQL ) { $lbConf['srvCache'] = $sCache; } - $cCache = ObjectCache::getLocalClusterInstance(); - if ( $cCache->getQoS( $cCache::ATTR_EMULATION ) > $cCache::QOS_EMULATION_SQL ) { - $lbConf['memStash'] = $cCache; + $mStash = $services->getMainObjectStash(); + if ( $mStash->getQoS( $mStash::ATTR_EMULATION ) > $mStash::QOS_EMULATION_SQL ) { + $lbConf['memStash'] = $mStash; } - $wCache = MediaWikiServices::getInstance()->getMainWANObjectCache(); + $wCache = $services->getMainWANObjectCache(); if ( $wCache->getQoS( $wCache::ATTR_EMULATION ) > $wCache::QOS_EMULATION_SQL ) { $lbConf['wanCache'] = $wCache; }