Skip to content

Commit

Permalink
fix external repl switchover, add mysql-db ignore in external repl
Browse files Browse the repository at this point in the history
  • Loading branch information
suetin committed Aug 8, 2023
1 parent 96e311d commit 6077291
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,14 @@ func (app *App) repairSlaveNode(node *mysql.Node, clusterState map[string]*NodeS
if err != nil {
app.logger.Errorf("repair: %s", err)
}
err = node.StopExternalReplication()
if err != nil {
app.logger.Errorf("repair: %s", err)
}
err = node.ResetExternalReplicationAll()
if err != nil {
app.logger.Errorf("repair: %s", err)
}
app.logger.Infof("repair: turning stale master %s to new master %s", host, master)
err = app.performChangeMaster(host, master)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/mysql/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -999,8 +999,8 @@ func (n *Node) SetExternalReplication() error {
return err
}
err = n.execMogrify(queryIgnoreDB, map[string]interface{}{

Check failure on line 1001 in internal/mysql/node.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to err (ineffassign)
"ignoreList": schemaname("mysql"),
"channel": "external",
"ignoreList": schemaname("mysql"),
"channel": "external",
})
return n.StartExternalReplication()
}
Expand Down

0 comments on commit 6077291

Please sign in to comment.