Removed $wgAntiLockFlags to unify the code paths

Change-Id: Ia709ccdc9addc55c99cbff21a5ff3009b5fbb53c
This commit is contained in:
Aaron Schulz 2014-10-01 10:23:00 -07:00
parent 31f73c4213
commit 12757b50f8
4 changed files with 4 additions and 26 deletions

View 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

View 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
*/

View 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 );

View 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 );