Use write connection and transactions in SQL patches
Summary: Patches often read from slaves (possibly stale data) and use that information to write on master. It causes problems when applying more patches quickly after each other because data created in previous patch may not be replicated yet. Test Plan: $ bin/storage upgrade Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4483
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
<?php
|
||||
|
||||
echo "Migrating task dependencies to edges...\n";
|
||||
foreach (new LiskMigrationIterator(new ManiphestTask()) as $task) {
|
||||
$table = new ManiphestTask();
|
||||
$table->openTransaction();
|
||||
|
||||
foreach (new LiskMigrationIterator($table) as $task) {
|
||||
$id = $task->getID();
|
||||
echo "Task {$id}: ";
|
||||
|
||||
@@ -23,4 +26,5 @@ foreach (new LiskMigrationIterator(new ManiphestTask()) as $task) {
|
||||
echo "OKAY\n";
|
||||
}
|
||||
|
||||
$table->saveTransaction();
|
||||
echo "Done.\n";
|
||||
|
||||
Reference in New Issue
Block a user