From 5547e66d28669e94ef042ad3e464e6baec79e0e3 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 16 Aug 2017 20:13:35 -0700 Subject: [PATCH] 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 --- includes/db/MWLBFactory.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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; } -- 2.20.1