Skip to content

Commit

Permalink
Merge branch 'master' into jepsen/read_timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
teem0n authored Oct 9, 2024
2 parents 0eaa024 + 6240503 commit 7b8e6a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1260,13 +1260,17 @@ func (app *App) performSwitchover(clusterState map[string]*NodeState, activeNode

errs2 := util.RunParallel(func(host string) error {
if !clusterState[host].PingOk {
return fmt.Errorf("switchover: failed to ping host %s", host)
errMessage := fmt.Sprintf("switchover: failed to ping host %s", host)
app.logger.Warn(errMessage)
return fmt.Errorf("%s", errMessage)
}
node := app.cluster.Get(host)
// in case node is a replica
err := node.StopSlaveIOThread()
if err != nil || app.emulateError("freeze_stop_slave_io") {
return fmt.Errorf("failed to stop slave on host %s: %s", host, err)
errMessage := fmt.Sprintf("failed to stop slave on host %s: %s", host, err)
app.logger.Warn(errMessage)
return fmt.Errorf("%s", errMessage)
}
app.logger.Infof("switchover: host %s replication IO thread stopped", host)
return nil
Expand Down

0 comments on commit 7b8e6a3

Please sign in to comment.