From 12757b50f8dae771a5058235548a38f03c7cfdef Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 1 Oct 2014 10:23:00 -0700 Subject: [PATCH] Removed $wgAntiLockFlags to unify the code paths Change-Id: Ia709ccdc9addc55c99cbff21a5ff3009b5fbb53c --- RELEASE-NOTES-1.25 | 1 + includes/DefaultSettings.php | 9 --------- includes/cache/LinkCache.php | 10 ++-------- includes/deferred/SqlDataUpdate.php | 10 +--------- 4 files changed, 4 insertions(+), 26 deletions(-) diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index db4c124625..95ff2d3ca1 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -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 diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index c6e91cf2cf..f2453e842a 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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 */ diff --git a/includes/cache/LinkCache.php b/includes/cache/LinkCache.php index 6925df9013..82fb12dcc5 100644 --- a/includes/cache/LinkCache.php +++ b/includes/cache/LinkCache.php @@ -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 ); diff --git a/includes/deferred/SqlDataUpdate.php b/includes/deferred/SqlDataUpdate.php index 9c58503f1b..7ec61ea704 100644 --- a/includes/deferred/SqlDataUpdate.php +++ b/includes/deferred/SqlDataUpdate.php @@ -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 ); -- 2.20.1