Skip to content

Commit

Permalink
fix: issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizic committed May 23, 2024
1 parent 8a1f02f commit 174710d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
13 changes: 4 additions & 9 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ func (app *App) checkRecovery() {

if isSlavePermanentlyLost(sstatus, mgtids) {
rp, err := localNode.GetReplicaStatus()
if err != nil {
app.logger.Errorf("recovery: local node %s is NOT behind the master %s, need RESETUP", localNode.Host(), masterNode)
if err == nil {
app.logger.Errorf("recovery: local node %s has IO errno: %d", localNode.Host(), rp.GetLastIOErrno())
} else {
app.logger.Errorf("recovery: local node %s is NOT behind the master %s, need RESETUP, last IO errno: %d", localNode.Host(), masterNode, rp.GetLastIOErrno())
app.logger.Errorf("recovery: local node %s is NOT behind the master %s, need RESETUP", localNode.Host(), masterNode)
}
app.writeResetupFile("")
} else {
Expand Down Expand Up @@ -1072,12 +1072,7 @@ func (app *App) enableSemiSyncOnSlave(host string) error {
app.logger.Errorf("failed to enable semi_sync_slave on %s: %s", host, err)
return err
}
err = node.RestartSlaveIOThread()
if err != nil {
app.logger.Errorf("failed restart slave io thread after set semi_sync_slave on %s: %s", host, err)
return err
}
err = node.RestartReplication()
err = node.RestartReplica()
if err != nil {
app.logger.Errorf("failed restart replication after set semi_sync_slave on %s: %s", host, err)
return err
Expand Down
4 changes: 2 additions & 2 deletions internal/mysql/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,8 @@ func (n *Node) StartSlave() error {
})
}

// RestartReplication restart replication
func (n *Node) RestartReplication() error {
// RestartReplica restart replication
func (n *Node) RestartReplica() error {
err := n.StopSlave()
if err != nil {
return err
Expand Down

0 comments on commit 174710d

Please sign in to comment.