Skip to content

Commit

Permalink
Cash with loglevel > 2 dynamic ring topology and vmaster found #665
Browse files Browse the repository at this point in the history
  • Loading branch information
svaroqui committed Jun 26, 2024
1 parent 702ff55 commit 3fe05a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,8 @@ func (cluster *Cluster) Run() {
cluster.LogModulePrintf(cluster.Conf.Verbose, config.ConstLogModGeneral, config.LvlDbg, "Servers loops k : %d, url : %s, state : %s, prevstate %s", k, v.URL, v.State, v.PrevState)
cluster.LogModulePrintf(cluster.Conf.Verbose, config.ConstLogModGeneral, config.LvlDbg, "Server [%d]: URL: %-15s State: %6s PrevState: %6s", k, v.URL, v.State, v.PrevState)
}
if cluster.GetMaster() != nil {
cluster.LogModulePrintf(cluster.Conf.Verbose, config.ConstLogModGeneral, config.LvlDbg, "Master [ ]: URL: %-15s State: %6s PrevState: %6s", cluster.master.URL, cluster.GetMaster().State, cluster.GetMaster().PrevState)
if m := cluster.GetMaster(); m != nil {
cluster.LogModulePrintf(cluster.Conf.Verbose, config.ConstLogModGeneral, config.LvlDbg, "Master [ ]: URL: %-15s State: %6s PrevState: %6s", m.URL, m.State, m.PrevState)
for k, v := range cluster.slaves {
cluster.LogModulePrintf(cluster.Conf.Verbose, config.ConstLogModGeneral, config.LvlDbg, "Slave [%d]: URL: %-15s State: %6s PrevState: %6s", k, v.URL, v.State, v.PrevState)
}
Expand Down
3 changes: 3 additions & 0 deletions cluster/cluster_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ func (cluster *Cluster) GetPersitentState() error {
}

func (cluster *Cluster) GetMaster() *ServerMonitor {
if cluster.master == nil && cluster.vmaster == nil {
return nil
}
if cluster.master == nil {
return cluster.vmaster
} else {
Expand Down

0 comments on commit 3fe05a8

Please sign in to comment.