From aaaec7e76eab48b879270b5796cb4a0cba8a3cc8 Mon Sep 17 00:00:00 2001 From: Jan Grodowski Date: Wed, 9 Jul 2025 13:51:12 +0200 Subject: [PATCH] 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. --- go/logic/applier.go | 1 + 1 file changed, 1 insertion(+) diff --git a/go/logic/applier.go b/go/logic/applier.go index a7edaed24..b3b77e98d 100644 --- a/go/logic/applier.go +++ b/go/logic/applier.go @@ -574,6 +574,7 @@ func (this *Applier) InitiateHeartbeat() { continue } if err := injectHeartbeat(); err != nil { + this.migrationContext.PanicAbort <- fmt.Errorf("injectHeartbeat writing failed %d times, last error: %w", numSuccessiveFailures, err) return } }