Skip to content

Commit aaaec7e

Browse files
committed
Panic if InitiateHeartbeat exhausts retries to avoid looping infinitely.
Based on experience, if the writer database fails inbeetween the copy & cutover stages (e.g. during cutover pause), the heartbeat writes will fail and stop, then leading to throttled state and an infinite loop of throttler.shouldThrottle(). Since this state is irrecoverable, make the heartbeat writer panic if retries are exhausted, so that the migration can fail and be restarted later.
1 parent 65f88c6 commit aaaec7e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

go/logic/applier.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ func (this *Applier) InitiateHeartbeat() {
574574
continue
575575
}
576576
if err := injectHeartbeat(); err != nil {
577+
this.migrationContext.PanicAbort <- fmt.Errorf("injectHeartbeat writing failed %d times, last error: %w", numSuccessiveFailures, err)
577578
return
578579
}
579580
}

0 commit comments

Comments
 (0)