Skip to content

Commit 6284a34

Browse files
author
Shlomi Noach
authored
Merge branch 'master' into ipv6
2 parents 04c0be6 + 2871843 commit 6284a34

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

go/logic/migrator.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,8 +1105,11 @@ func (this *Migrator) iterateChunks() error {
11051105

11061106
// When hasFurtherRange is false, original table might be write locked and CalculateNextIterationRangeEndValues would hangs forever
11071107

1108-
hasFurtherRange, err := this.applier.CalculateNextIterationRangeEndValues()
1109-
if err != nil {
1108+
hasFurtherRange := false
1109+
if err := this.retryOperation(func() (e error) {
1110+
hasFurtherRange, e = this.applier.CalculateNextIterationRangeEndValues()
1111+
return e
1112+
}); err != nil {
11101113
return terminateRowIteration(err)
11111114
}
11121115
if !hasFurtherRange {
@@ -1128,7 +1131,7 @@ func (this *Migrator) iterateChunks() error {
11281131
}
11291132
_, rowsAffected, _, err := this.applier.ApplyIterationInsertQuery()
11301133
if err != nil {
1131-
return terminateRowIteration(err)
1134+
return err // wrapping call will retry
11321135
}
11331136
atomic.AddInt64(&this.migrationContext.TotalRowsCopied, rowsAffected)
11341137
atomic.AddInt64(&this.migrationContext.Iteration, 1)

0 commit comments

Comments
 (0)