r85799 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85798‎ | r85799 | r85800 >
Date:16:42, 11 April 2011
Author:reedy
Status:reverted (Comments)
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/LinksUpdate.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LinksUpdate.php
@@ -345,15 +345,22 @@
346346 $where = false;
347347 }
348348 }
 349+
 350+ // Create and use a new loadBalancer object, to prevent "1205: Lock wait timeout exceeded;"
 351+ $lb = wfGetLBFactory()->newMainLB();
 352+ $dbw = $lb->getConnection( DB_MASTER );
 353+
349354 if ( $where ) {
350 - $this->mDb->delete( $table, $where, __METHOD__ );
 355+ $dbw->delete( $table, $where, __METHOD__ );
351356 }
352357 if ( count( $insertions ) ) {
353 - $this->mDb->insert( $table, $insertions, __METHOD__, 'IGNORE' );
 358+ $dbw->insert( $table, $insertions, __METHOD__, 'IGNORE' );
354359 }
 360+
 361+ $lb->commitMasterChanges();
 362+ $lb->closeAll();
355363 }
356364
357 -
358365 /**
359366 * Get an array of pagelinks insertions for passing to the DB
360367 * Skips the titles specified by the 2-D array $existing

Follow-up revisions

RevisionCommit summaryAuthorDate
r85812Revert r85799reedy18:37, 11 April 2011

Comments

#Comment by Reedy (talk | contribs)   18:44, 11 April 2011

logged as bug 28498

Status & tagging log