Skip to content

Commit 75d2253

Browse files
author
Shlomi Noach
authored
Merge pull request #220 from Wattpad/exit-on-hook-replication-stop-failure
Fail operation if onStopReplication hook fails
2 parents fd42ccf + e3662f2 commit 75d2253

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

go/logic/migrator.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,9 @@ func (this *Migrator) cutOver() (err error) {
408408
// the same cut-over phase as the master would use. That means we take locks
409409
// and swap the tables.
410410
// The difference is that we will later swap the tables back.
411-
this.hooksExecutor.onStopReplication()
411+
if err := this.hooksExecutor.onStopReplication(); err != nil {
412+
return err
413+
}
412414
if this.migrationContext.TestOnReplicaSkipReplicaStop {
413415
log.Warningf("--test-on-replica-skip-replica-stop enabled, we are not stopping replication.")
414416
} else {

0 commit comments

Comments
 (0)