From ec199f11858193131309e15399e15ceea54e4fc5 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Sun, 5 Jun 2022 00:06:41 +0200 Subject: [PATCH] revert out of scope change --- go/logic/migrator.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/go/logic/migrator.go b/go/logic/migrator.go index 13108bc..89106b7 100644 --- a/go/logic/migrator.go +++ b/go/logic/migrator.go @@ -537,20 +537,19 @@ func (this *Migrator) cutOver() (err error) { } } } - - switch this.migrationContext.CutOverType { - case base.CutOverAtomic: + if this.migrationContext.CutOverType == base.CutOverAtomic { // Atomic solution: we use low timeout and multiple attempts. But for // each failed attempt, we throttle until replication lag is back to normal - err = this.atomicCutOver() - case base.CutOverTwoStep: - err = this.cutOverTwoStep() - default: - return this.migrationContext.Log.Fatalf("Unknown cut-over type: %d; should never get here!", this.migrationContext.CutOverType) + err := this.atomicCutOver() + this.handleCutOverResult(err) + return err } - - this.handleCutOverResult(err) - return err + if this.migrationContext.CutOverType == base.CutOverTwoStep { + err := this.cutOverTwoStep() + this.handleCutOverResult(err) + return err + } + return this.migrationContext.Log.Fatalf("Unknown cut-over type: %d; should never get here!", this.migrationContext.CutOverType) } // Inject the "AllEventsUpToLockProcessed" state hint, wait for it to appear in the binary logs,