Turn off duplicate key gets for ReplicatedBagOStuff
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 5 Sep 2016 21:23:41 +0000 (14:23 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 5 Sep 2016 21:23:41 +0000 (14:23 -0700)
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
includes/libs/objectcache/ReplicatedBagOStuff.php

index a990525..a378c38 100644 (file)
@@ -2281,7 +2281,8 @@ $wgObjectCaches = [
                        'class' => 'SqlBagOStuff',
                        'args'  => [ [ 'slaveOnly' => false ] ]
                ],
-               'loggroup'  => 'SQLBagOStuff'
+               'loggroup'  => 'SQLBagOStuff',
+               'reportDupes' => false
        ],
 
        'apc' => [ 'class' => 'APCBagOStuff', 'reportDupes' => false ],
index f2ba9de..f8dba96 100644 (file)
@@ -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 ] );
        }