Fail operation if onStopReplication hook fails

This commit is contained in:
Paulo Bittencourt 2016-09-01 15:58:20 -04:00
parent dfde634cf6
commit e3662f2398

View File

@ -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 {