Removed $wgAntiLockFlags to unify the code paths
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 1 Oct 2014 17:23:00 +0000 (10:23 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 3 Oct 2014 17:42:17 +0000 (10:42 -0700)
Change-Id: Ia709ccdc9addc55c99cbff21a5ff3009b5fbb53c

RELEASE-NOTES-1.25
includes/DefaultSettings.php
includes/cache/LinkCache.php
includes/deferred/SqlDataUpdate.php

index db4c124..95ff2d3 100644 (file)
@@ -11,6 +11,7 @@ production.
 === Configuration changes in 1.25 ===
 * $wgPageShowWatchingUsers was removed.
 * $wgLocalVirtualHosts has been added to replace $wgConf->localVHosts.
+* $wgAntiLockFlags was removed.
 
 === New features in 1.25 ===
 * (bug 58139) ResourceLoaderFileModule now supports language fallback
index c6e91cf..f2453e8 100644 (file)
@@ -1997,15 +1997,6 @@ $wgAllowSlowParserFunctions = false;
  */
 $wgAllowSchemaUpdates = true;
 
-/**
- * Anti-lock flags - bitfield
- *   - ALF_NO_LINK_LOCK:
- *       Don't use locking reads when updating the link table. This is
- *       necessary for wikis with a high edit rate for performance
- *       reasons, but may cause link table inconsistency
- */
-$wgAntiLockFlags = 0;
-
 /**
  * Maximum article size in kilobytes
  */
index 6925df9..82fb12d 100644 (file)
@@ -216,7 +216,7 @@ class LinkCache {
         * @return int
         */
        public function addLinkObj( $nt ) {
-               global $wgAntiLockFlags, $wgContentHandlerUseDB;
+               global $wgContentHandlerUseDB;
 
                wfProfileIn( __METHOD__ );
 
@@ -242,14 +242,8 @@ class LinkCache {
                # Some fields heavily used for linking...
                if ( $this->mForUpdate ) {
                        $db = wfGetDB( DB_MASTER );
-                       if ( !( $wgAntiLockFlags & ALF_NO_LINK_LOCK ) ) {
-                               $options = array( 'FOR UPDATE' );
-                       } else {
-                               $options = array();
-                       }
                } else {
                        $db = wfGetDB( DB_SLAVE );
-                       $options = array();
                }
 
                $f = array( 'page_id', 'page_len', 'page_is_redirect', 'page_latest' );
@@ -259,7 +253,7 @@ class LinkCache {
 
                $s = $db->selectRow( 'page', $f,
                        array( 'page_namespace' => $nt->getNamespace(), 'page_title' => $nt->getDBkey() ),
-                       __METHOD__, $options );
+                       __METHOD__ );
                # Set fields...
                if ( $s !== false ) {
                        $this->addGoodLinkObjFromRow( $nt, $s );
index 9c58503..7ec61ea 100644 (file)
@@ -35,7 +35,7 @@ abstract class SqlDataUpdate extends DataUpdate {
        protected $mDb;
 
        /** @var array SELECT options to be used (array) */
-       protected $mOptions;
+       protected $mOptions = array();
 
        /** @var bool Whether a transaction is open on this object (internal use only!) */
        private $mHasTransaction;
@@ -51,16 +51,8 @@ abstract class SqlDataUpdate extends DataUpdate {
         *   transaction is already in progress, see beginTransaction() for details.
         */
        public function __construct( $withTransaction = true ) {
-               global $wgAntiLockFlags;
-
                parent::__construct();
 
-               if ( $wgAntiLockFlags & ALF_NO_LINK_LOCK ) {
-                       $this->mOptions = array();
-               } else {
-                       $this->mOptions = array( 'FOR UPDATE' );
-               }
-
                // @todo Get connection only when it's needed? Make sure that doesn't
                // break anything, especially transactions!
                $this->mDb = wfGetDB( DB_MASTER );