Merge "Turn off duplicate key gets for ReplicatedBagOStuff"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 6 Sep 2016 18:18:07 +0000 (18:18 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 6 Sep 2016 18:18:07 +0000 (18:18 +0000)
1  2 
includes/DefaultSettings.php
includes/libs/objectcache/ReplicatedBagOStuff.php

@@@ -1895,7 -1895,7 +1895,7 @@@ $wgSharedSchema = false
   *   - password:    DB password
   *   - type:        DB type
   *
 - *   - load:        Ratio of DB_SLAVE load, must be >=0, the sum of all loads must be >0.
 + *   - load:        Ratio of DB_REPLICA load, must be >=0, the sum of all loads must be >0.
   *                  If this is zero for any given server, no normal query traffic will be
   *                  sent to it. It will be excluded from lag checks in maintenance scripts.
   *                  The only way it can receive traffic is if groupLoads is used.
   *                  - DBO_COMPRESS -- uses internal compression in database connections,
   *                                    if available
   *
 - *   - max lag:     (optional) Maximum replication lag before a slave will taken out of rotation
 + *   - max lag:     (optional) Maximum replication lag before a replica DB goes out of rotation
   *   - is static:   (optional) Set to true if the dataset is static and no replication is used.
   *   - cliMode:     (optional) Connection handles will not assume that requests are short-lived
   *                  nor that INSERT..SELECT can be rewritten into a buffered SELECT and INSERT.
   * perhaps in some command-line scripts).
   *
   * The first server listed in this array (with key 0) will be the master. The
 - * rest of the servers will be slaves. To prevent writes to your slaves due to
 + * rest of the servers will be replica DBs. To prevent writes to your replica DBs due to
   * accidental misconfiguration or MediaWiki bugs, set read_only=1 on all your
 - * slaves in my.cnf. You can set read_only mode at runtime using:
 + * replica DBs in my.cnf. You can set read_only mode at runtime using:
   *
   * @code
   *     SET @@read_only=1;
   * @endcode
   *
 - * Since the effect of writing to a slave is so damaging and difficult to clean
 + * Since the effect of writing to a replica DB is so damaging and difficult to clean
   * up, we at Wikimedia set read_only=1 in my.cnf on all our DB servers, even
   * our masters, and then set read_only=0 on masters at runtime.
   */
@@@ -2281,7 -2281,8 +2281,8 @@@ $wgObjectCaches = 
                        'class' => 'SqlBagOStuff',
                        'args'  => [ [ 'slaveOnly' => false ] ]
                ],
-               'loggroup'  => 'SQLBagOStuff'
+               'loggroup'  => 'SQLBagOStuff',
+               'reportDupes' => false
        ],
  
        'apc' => [ 'class' => 'APCBagOStuff', 'reportDupes' => false ],
@@@ -2660,7 -2661,7 +2661,7 @@@ $wgInternalServer = false
  $wgSquidMaxage = 18000;
  
  /**
 - * Cache timeout for the CDN when DB slave lag is high
 + * Cache timeout for the CDN when DB replica DB lag is high
   * @see $wgSquidMaxage
   * @since 1.27
   */
@@@ -2670,7 -2671,7 +2671,7 @@@ $wgCdnMaxageLagged = 30
   * If set, any SquidPurge call on a URL or URLs will send a second purge no less than
   * this many seconds later via the job queue. This requires delayed job support.
   * This should be safely higher than the 'max lag' value in $wgLBFactoryConf, so that
 - * slave lag does not cause page to be stuck in stales states in CDN.
 + * replica DB lag does not cause page to be stuck in stales states in CDN.
   *
   * This also fixes race conditions in two-tiered CDN setups (e.g. cdn2 => cdn1 => MediaWiki).
   * If a purge for a URL reaches cdn2 before cdn1 and a request reaches cdn2 for that URL,
@@@ -7219,8 -7220,8 +7220,8 @@@ $wgJobTypesExcludedFromDefaultQueue = 
  $wgJobBackoffThrottling = [];
  
  /**
 - * Make job runners commit changes for slave-lag prone jobs one job at a time.
 - * This is useful if there are many job workers that race on slave lag checks.
 + * Make job runners commit changes for replica DB-lag prone jobs one job at a time.
 + * This is useful if there are many job workers that race on replica DB lag checks.
   * If set, jobs taking this many seconds of DB write time have serialized commits.
   *
   * Note that affected jobs may have worse lock contention. Also, if they affect
@@@ -7842,7 -7843,7 +7843,7 @@@ $wgAPIMaxResultSize = 8388608
  $wgAPIMaxUncachedDiffs = 1;
  
  /**
 - * Maximum amount of DB lag on a majority of DB slaves to tolerate
 + * Maximum amount of DB lag on a majority of DB replica DBs to tolerate
   * before forcing bots to retry any write requests via API errors.
   * This should be lower than the 'max lag' value in $wgLBFactoryConf.
   */
@@@ -22,7 -22,7 +22,7 @@@
  
  /**
   * A cache class that directs writes to one set of servers and reads to
 - * another. This assumes that the servers used for reads are setup to slave
 + * another. This assumes that the servers used for reads are setup to replica DB
   * those that writes go to. This can easily be used with redis for example.
   *
   * In the WAN scenario (e.g. multi-datacenter case), this is useful when
@@@ -42,7 -42,7 +42,7 @@@ class ReplicatedBagOStuff extends BagOS
         *   - writeFactory : ObjectFactory::getObjectFromSpec array yeilding BagOStuff.
         *                    This object will be used for writes (e.g. the master DB).
         *   - readFactory  : ObjectFactory::getObjectFromSpec array yeilding BagOStuff.
 -       *                    This object will be used for reads (e.g. a slave DB).
 +       *                    This object will be used for reads (e.g. a replica DB).
         *
         * @param array $params
         * @throws InvalidArgumentException
                                __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 ] );
        }