From e3662f23981aaad3f1fe972da65f4f37f8ad15cd Mon Sep 17 00:00:00 2001 From: Paulo Bittencourt Date: Thu, 1 Sep 2016 15:58:20 -0400 Subject: [PATCH] Fail operation if onStopReplication hook fails --- go/logic/migrator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/go/logic/migrator.go b/go/logic/migrator.go index e9c1426..7d36567 100644 --- a/go/logic/migrator.go +++ b/go/logic/migrator.go @@ -408,7 +408,9 @@ func (this *Migrator) cutOver() (err error) { // the same cut-over phase as the master would use. That means we take locks // and swap the tables. // The difference is that we will later swap the tables back. - this.hooksExecutor.onStopReplication() + if err := this.hooksExecutor.onStopReplication(); err != nil { + return err + } if this.migrationContext.TestOnReplicaSkipReplicaStop { log.Warningf("--test-on-replica-skip-replica-stop enabled, we are not stopping replication.") } else {