Skip to content

Commit ebc6f9b

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 568e756 commit ebc6f9b

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
@@ -1250,14 +1250,9 @@ func (this *Migrator) iterateChunks() error {
12501250
}
12511251

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

0 commit comments

Comments
 (0)