Skip to content

Commit

Permalink
fix: split brain due to outdated information on the source
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizic committed Mar 11, 2024
1 parent e4dc375 commit 5af95a6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2091,6 +2091,16 @@ func (app *App) getClusterStateFromDB() map[string]*NodeState {
return app.getNodeState(host), nil
}
clusterState, _ := getNodeStatesInParallel(hosts, getter)

// it is necessary to get an up-to-date gtid from the source
for host, state := range clusterState {
if !state.IsMaster {
continue
}
clusterState[host] = app.getNodeState(host)
break
}

return clusterState
}

Expand Down

0 comments on commit 5af95a6

Please sign in to comment.