Skip to content

Commit 0951164

Browse files
committed
Remove double retries
CalculateNextIterationRangeEndValues needs to be recomputed on every retry in case of configuration (e.g. chunk-size) changes were made by onBatchCopyRetry hooks.
1 parent 2bc897f commit 0951164

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

go/logic/migrator.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,14 +1253,9 @@ func (this *Migrator) iterateChunks() error {
12531253
}
12541254

12551255
// When hasFurtherRange is false, original table might be write locked and CalculateNextIterationRangeEndValues would hangs forever
1256-
1257-
hasFurtherRange := false
1258-
// TODO: figure out how to rewrite this double retry?
1259-
if err := this.retryOperation(func() (e error) {
1260-
hasFurtherRange, e = this.applier.CalculateNextIterationRangeEndValues()
1261-
return e
1262-
}); err != nil {
1263-
return terminateRowIteration(err)
1256+
hasFurtherRange, err := this.applier.CalculateNextIterationRangeEndValues()
1257+
if err != nil {
1258+
return err // wrapping call will retry
12641259
}
12651260
if !hasFurtherRange {
12661261
atomic.StoreInt64(&hasNoFurtherRangeFlag, 1)

0 commit comments

Comments
 (0)