From: Neil Kandalgaonkar Date: Tue, 20 Dec 2011 23:02:42 +0000 (+0000) Subject: fix race condition in UploadFromChunks, followup to r104687 X-Git-Tag: 1.31.0-rc.0~25843 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=1a8f61e60699c16d1356431987c88c1eb4fc8e84;p=lhc%2Fweb%2Fwiklou.git fix race condition in UploadFromChunks, followup to r104687 --- diff --git a/includes/upload/UploadFromChunks.php b/includes/upload/UploadFromChunks.php index 01bc111ee6..3a5f8099be 100644 --- a/includes/upload/UploadFromChunks.php +++ b/includes/upload/UploadFromChunks.php @@ -187,8 +187,10 @@ class UploadFromChunks extends UploadFromFile { * Get the chunk db state and populate update relevant local values */ private function getChunkStatus(){ - $dbr = $this->repo->getSlaveDb(); - $row = $dbr->selectRow( + // get Master db to avoid race conditions. + // Otherwise, if chunk upload time < replag there will be spurious errors + $dbw = $this->repo->getMasterDb(); + $row = $dbw->selectRow( 'uploadstash', array( 'us_chunk_inx',