Skip to content

Commit bfd8cf8

Browse files
Mixficsolwuxianrong
andauthored
fix: Example Repair the subjective and objective offline logic of noeds (OpenAtomFoundation#3049)
* Example Repair the subjective and objective offline logic of primary and secondary nodes * fix comment --------- Co-authored-by: wuxianrong <[email protected]>
1 parent 5dda459 commit bfd8cf8

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

codis/pkg/topom/topom_sentinel.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,17 @@ func (s *Topom) checkAndUpdateGroupServerState(conf *Config, group *models.Group
7474
}
7575

7676
// Start the election master node
77-
if groupServer.State == models.GroupServerStateOffline && isGroupMaster(state, group) {
78-
*masterOfflineGroups = append(*masterOfflineGroups, group)
79-
} else {
80-
*slaveOfflineGroups = append(*slaveOfflineGroups, group)
77+
// Currently, both primary and secondary nodes have subjective and objective logics.
78+
// If it is subjective, we will not perform any operation. If more than 10 probe counts
79+
// fail, it is defined as objective logics, If it is an objective offline, we will add the
80+
// node to masterOfflineGroups or slaveOfflineGroups respectively, and then notify the Proxy
81+
// to change the meta information
82+
if groupServer.State == models.GroupServerStateOffline {
83+
if isGroupMaster(state, group) {
84+
*masterOfflineGroups = append(*masterOfflineGroups, group)
85+
} else {
86+
*slaveOfflineGroups = append(*slaveOfflineGroups, group)
87+
}
8188
}
8289
}
8390
} else {

0 commit comments

Comments
 (0)