From: Aaron Schulz Date: Mon, 5 Sep 2016 21:23:41 +0000 (-0700) Subject: Turn off duplicate key gets for ReplicatedBagOStuff X-Git-Tag: 1.31.0-rc.0~5750^2 X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=commitdiff_plain;h=45adeddf1bf4c47e6ea396d9684348cfd8215d08;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ] ); }