* (bug 28485) Block::purgeExpired Database returned error "1205: Lock wait timeout
exceeded;"
* (bug 20468) User::invalidateCache throws 1205: Lock wait timeout exceeded
+* (bug 27639) Transaction timeout when trying to OldLocalFile::upgradeRow()
=== API changes in 1.18 ===
* (bug 26339) Throw warning when truncating an overlarge API result
return;
}
- $dbw = $this->repo->getMasterDB();
list( $major, $minor ) = self::splitMime( $this->mime );
+ // https://bugzilla.wikimedia.org/show_bug.cgi?id=27639
+ // Create and use a new loadBalancer object, to prevent "1205: Lock wait timeout exceeded;"
+ $lb = wfGetLBFactory()->newMainLB();
+ $dbw = $lb->getConnection( DB_MASTER );
+
wfDebug(__METHOD__.': upgrading '.$this->archive_name." to the current schema\n");
$dbw->update( 'oldimage',
array(
'oi_archive_name' => $this->archive_name ),
__METHOD__
);
+
+ $lb->commitMasterChanges();
+ $lb->closeAll();
wfProfileOut( __METHOD__ );
}