From 45adeddf1bf4c47e6ea396d9684348cfd8215d08 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 5 Sep 2016 14:23:41 -0700 Subject: [PATCH] Turn off duplicate key gets for ReplicatedBagOStuff This is used as the main stash by default, which is not a performance cache but a stash for ephemeral values typically. Change-Id: Ie3740c0387f36a3f9b2d8d7d3b4e04ee9238ab1a --- includes/DefaultSettings.php | 3 ++- includes/libs/objectcache/ReplicatedBagOStuff.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index a990525def..a378c3898a 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2281,7 +2281,8 @@ $wgObjectCaches = [ 'class' => 'SqlBagOStuff', 'args' => [ [ 'slaveOnly' => false ] ] ], - 'loggroup' => 'SQLBagOStuff' + 'loggroup' => 'SQLBagOStuff', + 'reportDupes' => false ], 'apc' => [ 'class' => 'APCBagOStuff', 'reportDupes' => false ], diff --git a/includes/libs/objectcache/ReplicatedBagOStuff.php b/includes/libs/objectcache/ReplicatedBagOStuff.php index f2ba9de032..f8dba963fb 100644 --- a/includes/libs/objectcache/ReplicatedBagOStuff.php +++ b/includes/libs/objectcache/ReplicatedBagOStuff.php @@ -59,12 +59,13 @@ class ReplicatedBagOStuff extends BagOStuff { __METHOD__ . ': the "readFactory" parameter is required' ); } + $opts = [ 'reportDupes' => false ]; // redundant $this->writeStore = ( $params['writeFactory'] instanceof BagOStuff ) ? $params['writeFactory'] - : ObjectFactory::getObjectFromSpec( $params['writeFactory'] ); + : ObjectFactory::getObjectFromSpec( $opts + $params['writeFactory'] ); $this->readStore = ( $params['readFactory'] instanceof BagOStuff ) ? $params['readFactory'] - : ObjectFactory::getObjectFromSpec( $params['readFactory'] ); + : ObjectFactory::getObjectFromSpec( $opts + $params['readFactory'] ); $this->attrMap = $this->mergeFlagMaps( [ $this->readStore, $this->writeStore ] ); } -- 2.20.1