r106887 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106886‎ | r106887 | r106888 >
Date:23:02, 20 December 2011
Author:neilk
Status:ok
Tags:
Comment:
fix race condition in UploadFromChunks, followup to r104687
Modified paths:
  • /trunk/phase3/includes/upload/UploadFromChunks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadFromChunks.php
@@ -187,8 +187,10 @@
188188 * Get the chunk db state and populate update relevant local values
189189 */
190190 private function getChunkStatus(){
191 - $dbr = $this->repo->getSlaveDb();
192 - $row = $dbr->selectRow(
 191+ // get Master db to avoid race conditions.
 192+ // Otherwise, if chunk upload time < replag there will be spurious errors
 193+ $dbw = $this->repo->getMasterDb();
 194+ $row = $dbw->selectRow(
193195 'uploadstash',
194196 array(
195197 'us_chunk_inx',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104687Use database to track uploaded chunks and concatenate at the end....j14:56, 30 November 2011

Status & tagging log