File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1087,6 +1087,8 @@ func (this *Migrator) iterateChunks() error {
1087
1087
log .Debugf ("No rows found in table. Rowcopy will be implicitly empty" )
1088
1088
return terminateRowIteration (nil )
1089
1089
}
1090
+
1091
+ hasFurtherRange := true
1090
1092
// Iterate per chunk:
1091
1093
for {
1092
1094
if atomic .LoadInt64 (& this .rowCopyCompleteFlag ) == 1 {
@@ -1100,7 +1102,10 @@ func (this *Migrator) iterateChunks() error {
1100
1102
// There's another such check down the line
1101
1103
return nil
1102
1104
}
1103
- hasFurtherRange , err := this .applier .CalculateNextIterationRangeEndValues ()
1105
+
1106
+ // When hasFurtherRange is false, original table might be write locked and CalculateNextIterationRangeEndValues would hangs forever
1107
+ var err error
1108
+ hasFurtherRange , err = this .applier .CalculateNextIterationRangeEndValues ()
1104
1109
if err != nil {
1105
1110
return terminateRowIteration (err )
1106
1111
}
@@ -1135,6 +1140,9 @@ func (this *Migrator) iterateChunks() error {
1135
1140
}
1136
1141
// Enqueue copy operation; to be executed by executeWriteFuncs()
1137
1142
this .copyRowsQueue <- copyRowsFunc
1143
+ if ! hasFurtherRange {
1144
+ break
1145
+ }
1138
1146
}
1139
1147
return nil
1140
1148
}
You can’t perform that action at this time.
0 commit comments