mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
server: Extract triggerCorruptAlarm to function
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
@@ -175,14 +175,7 @@ func (s *EtcdServer) checkHashKV() error {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
alarmed = true
|
alarmed = true
|
||||||
a := &pb.AlarmRequest{
|
s.triggerCorruptAlarm(id)
|
||||||
MemberID: id,
|
|
||||||
Action: pb.AlarmRequest_ACTIVATE,
|
|
||||||
Alarm: pb.AlarmType_CORRUPT,
|
|
||||||
}
|
|
||||||
s.GoAttach(func() {
|
|
||||||
s.raftRequest(s.ctx, pb.InternalRaftRequest{Alarm: a})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if h2 != h && rev2 == rev && crev == crev2 {
|
if h2 != h && rev2 == rev && crev == crev2 {
|
||||||
@@ -245,6 +238,17 @@ func (s *EtcdServer) checkHashKV() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *EtcdServer) triggerCorruptAlarm(id uint64) {
|
||||||
|
a := &pb.AlarmRequest{
|
||||||
|
MemberID: id,
|
||||||
|
Action: pb.AlarmRequest_ACTIVATE,
|
||||||
|
Alarm: pb.AlarmType_CORRUPT,
|
||||||
|
}
|
||||||
|
s.GoAttach(func() {
|
||||||
|
s.raftRequest(s.ctx, pb.InternalRaftRequest{Alarm: a})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
type peerInfo struct {
|
type peerInfo struct {
|
||||||
id types.ID
|
id types.ID
|
||||||
eps []string
|
eps []string
|
||||||
|
|||||||
Reference in New Issue
Block a user