Merge "Made wl_notificationtimestamp updates able to use queues"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 4 May 2015 18:35:45 +0000 (18:35 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 4 May 2015 18:35:45 +0000 (18:35 +0000)
1  2 
includes/DefaultSettings.php
includes/User.php

@@@ -1587,6 -1587,15 +1587,15 @@@ $wgEnotifMaxRecips = 500
   */
  $wgEnotifUseJobQ = false;
  
+ /**
+  * Use the job queue for user activity updates like updating "last visited"
+  * fields for email notifications of page changes. This should only be enabled
+  * if the jobs have a dedicated runner to avoid update lag.
+  *
+  * @since 1.26
+  */
+ $wgActivityUpdatesUseJobQueue = false;
  /**
   * Use real name instead of username in e-mail "from" field.
   */
@@@ -2148,13 -2157,11 +2157,13 @@@ $wgObjectCaches = array
   * cache with a relayer of type EventRelayerNull.
   *
   * The options are:
 + *   - false:            Configure the cache using $wgMainCacheType, without using
 + *                       a relayer (only matters if there are multiple data-centers)
   *   - CACHE_NONE:       Do not cache
   *   - (other):          A string may be used which identifies a cache
   *                       configuration in $wgWANObjectCaches.
   */
 -$wgMainWANCache = CACHE_NONE;
 +$wgMainWANCache = false;
  
  /**
   * Advanced WAN object cache configuration.
@@@ -5297,21 -5304,6 +5306,21 @@@ $wgDebugDumpSql = false
   */
  $wgDebugDumpSqlLength = 500;
  
 +/**
 + * Performance expectations for DB usage
 + *
 + * @since 1.26
 + */
 +$wgTrxProfilerLimits = array(
 +      // Basic GET and POST requests
 +      'GET'  => array( 'masterConns' => 0, 'writes' => 0, 'readQueryTime' => 5 ),
 +      'POST' => array( 'maxAffected' => 500, 'readQueryTime' => 5, 'writeQueryTime' => 1 ),
 +      // Background job runner
 +      'JobRunner' => array( 'maxAffected' => 500, 'readQueryTime' => 30, 'writeQueryTime' => 5 ),
 +      // Command-line scripts
 +      'Maintenance' => array( 'maxAffected' => 1000, 'writeQueryTime' => 5 )
 +);
 +
  /**
   * Map of string log group names to log destinations.
   *
@@@ -6484,6 -6476,7 +6493,7 @@@ $wgJobClasses = array
        'ThumbnailRender' => 'ThumbnailRenderJob',
        'recentChangesUpdate' => 'RecentChangesUpdateJob',
        'refreshLinksPrioritized' => 'RefreshLinksJob', // for cascading protection
+       'activityUpdateJob' => 'ActivityUpdateJob',
        'enqueue' => 'EnqueueJob', // local queue for multi-DC setups
        'null' => 'NullJob'
  );
@@@ -6512,21 -6505,6 +6522,21 @@@ $wgJobTypesExcludedFromDefaultQueue = a
   */
  $wgJobBackoffThrottling = array();
  
 +/**
 + * 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.
 + * 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
 + * several DBs at once they may have a smaller chance of being atomic due to the
 + * possibility of connection loss while queueing up to commit. Affected jobs may
 + * also fail due to the commit lock acquisition timeout.
 + *
 + * @var float|bool
 + * @since 1.26
 + */
 +$wgJobSerialCommitThreshold = false;
 +
  /**
   * Map of job types to configuration arrays.
   * This determines which queue class and storage system is used for each job type.
diff --combined includes/User.php
@@@ -2252,6 -2252,8 +2252,6 @@@ class User implements IDBAccessObject 
         *   page. Ignored if null or !$val.
         */
        public function setNewtalk( $val, $curRev = null ) {
 -              global $wgMemc;
 -
                if ( wfReadOnly() ) {
                        return;
                }
                        $changed = $this->deleteNewtalk( $field, $id );
                }
  
 -              if ( $this->isAnon() ) {
 -                      // Anons have a separate memcached space, since
 -                      // user records aren't kept for them.
 -                      $key = wfMemcKey( 'newtalk', 'ip', $id );
 -                      $wgMemc->set( $key, $val ? 1 : 0, 1800 );
 -              }
                if ( $changed ) {
                        $this->invalidateCache();
                }
                        $force = 'force';
                }
  
-               $this->getWatchedItem( $title )->resetNotificationTimestamp( $force, $oldid );
+               $this->getWatchedItem( $title )->resetNotificationTimestamp(
+                       $force, $oldid, WatchedItem::DEFERRED
+               );
        }
  
        /**