aboutsummaryrefslogtreecommitdiffstats
path: root/includes/LinksUpdate.php
diff options
context:
space:
mode:
authorSam Reed <reedy@users.mediawiki.org>2011-04-11 16:42:23 +0000
committerSam Reed <reedy@users.mediawiki.org>2011-04-11 16:42:23 +0000
commitc67bfb7884e29bc7d3a8cfc6d0867eea9de42def (patch)
tree19c42379dafff87ce90e59d4367a239e0a490ed1 /includes/LinksUpdate.php
parent8ec3ce80d96c36d9e37bb24384df72b9b59d9533 (diff)
downloadmediawikicore-c67bfb7884e29bc7d3a8cfc6d0867eea9de42def.tar.gz
mediawikicore-c67bfb7884e29bc7d3a8cfc6d0867eea9de42def.zip
commons.wikimedia: (SQL Query hidden) from within function "LinksUpdate::incrTableUpdate". Database returned error "1205: Lock wait timeout exceeded; try restarting transaction (10.0.6.41)".
Per Krinkle on IRC
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85799
Diffstat (limited to 'includes/LinksUpdate.php')
-rw-r--r--includes/LinksUpdate.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php
index a800fdfa07d8..c0bf54311052 100644
--- a/includes/LinksUpdate.php
+++ b/includes/LinksUpdate.php
@@ -345,14 +345,21 @@ class LinksUpdate {
$where = false;
}
}
+
+ // Create and use a new loadBalancer object, to prevent "1205: Lock wait timeout exceeded;"
+ $lb = wfGetLBFactory()->newMainLB();
+ $dbw = $lb->getConnection( DB_MASTER );
+
if ( $where ) {
- $this->mDb->delete( $table, $where, __METHOD__ );
+ $dbw->delete( $table, $where, __METHOD__ );
}
if ( count( $insertions ) ) {
- $this->mDb->insert( $table, $insertions, __METHOD__, 'IGNORE' );
+ $dbw->insert( $table, $insertions, __METHOD__, 'IGNORE' );
}
- }
+ $lb->commitMasterChanges();
+ $lb->closeAll();
+ }
/**
* Get an array of pagelinks insertions for passing to the DB