diff --git a/codis/pkg/topom/topom_sentinel.go b/codis/pkg/topom/topom_sentinel.go index f43a53fce6..b190b93988 100644 --- a/codis/pkg/topom/topom_sentinel.go +++ b/codis/pkg/topom/topom_sentinel.go @@ -74,10 +74,17 @@ func (s *Topom) checkAndUpdateGroupServerState(conf *Config, group *models.Group } // Start the election master node - if groupServer.State == models.GroupServerStateOffline && isGroupMaster(state, group) { - *masterOfflineGroups = append(*masterOfflineGroups, group) - } else { - *slaveOfflineGroups = append(*slaveOfflineGroups, group) + // Currently, both primary and secondary nodes have subjective and objective logics. + // If it is subjective, we will not perform any operation. If more than 10 probe counts + // fail, it is defined as objective logics, If it is an objective offline, we will add the + // node to masterOfflineGroups or slaveOfflineGroups respectively, and then notify the Proxy + // to change the meta information + if groupServer.State == models.GroupServerStateOffline { + if isGroupMaster(state, group) { + *masterOfflineGroups = append(*masterOfflineGroups, group) + } else { + *slaveOfflineGroups = append(*slaveOfflineGroups, group) + } } } } else {