Index: trunk/phase3/includes/upload/UploadFromChunks.php |
— | — | @@ -187,8 +187,10 @@ |
188 | 188 | * Get the chunk db state and populate update relevant local values |
189 | 189 | */ |
190 | 190 | 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( |
193 | 195 | 'uploadstash', |
194 | 196 | array( |
195 | 197 | 'us_chunk_inx', |