Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions codis/pkg/topom/topom_sentinel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading