Skip to content

Commit

Permalink
Merge pull request #732 from signal18/topology
Browse files Browse the repository at this point in the history
Fix master not refreshing after reconnect from suspect
  • Loading branch information
caffeinated92 authored Jul 16, 2024
2 parents a8b0969 + b957174 commit 48ad128
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cluster/cluster_topo.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ func (cluster *Cluster) TopologyDiscover(wcg *sync.WaitGroup) error {
cluster.master = cluster.Servers[k]
cluster.master.SetMaster()
}

// Set master when master reconnect after become suspect
if cluster.master == cluster.Servers[k] && cluster.master.State == stateSuspect {
cluster.master.SetMaster()
}

if cluster.master.IsReadOnly() && !cluster.master.IsRelay {
cluster.master.SetReadWrite()
cluster.LogModulePrintf(cluster.Conf.Verbose, config.ConstLogModTopology, config.LvlInfo, "Server %s disable read only as last non slave", cluster.master.URL)
Expand Down

0 comments on commit 48ad128

Please sign in to comment.