Merge branch 'master' into add-dry-run-env

This commit is contained in:
Shlomi Noach 2018-10-02 14:08:08 +03:00 committed by GitHub
commit 60398e774f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1105,8 +1105,11 @@ func (this *Migrator) iterateChunks() error {
// When hasFurtherRange is false, original table might be write locked and CalculateNextIterationRangeEndValues would hangs forever // When hasFurtherRange is false, original table might be write locked and CalculateNextIterationRangeEndValues would hangs forever
hasFurtherRange, err := this.applier.CalculateNextIterationRangeEndValues() hasFurtherRange := false
if err != nil { if err := this.retryOperation(func() (e error) {
hasFurtherRange, e = this.applier.CalculateNextIterationRangeEndValues()
return e
}); err != nil {
return terminateRowIteration(err) return terminateRowIteration(err)
} }
if !hasFurtherRange { if !hasFurtherRange {
@ -1128,7 +1131,7 @@ func (this *Migrator) iterateChunks() error {
} }
_, rowsAffected, _, err := this.applier.ApplyIterationInsertQuery() _, rowsAffected, _, err := this.applier.ApplyIterationInsertQuery()
if err != nil { if err != nil {
return terminateRowIteration(err) return err // wrapping call will retry
} }
atomic.AddInt64(&this.migrationContext.TotalRowsCopied, rowsAffected) atomic.AddInt64(&this.migrationContext.TotalRowsCopied, rowsAffected)
atomic.AddInt64(&this.migrationContext.Iteration, 1) atomic.AddInt64(&this.migrationContext.Iteration, 1)