corrupt.go (etcd-3.5.6) | : | corrupt.go (etcd-3.5.7) | ||
---|---|---|---|---|
skipping to change at line 197 | skipping to change at line 197 | |||
if err != nil { | if err != nil { | |||
return err | return err | |||
} | } | |||
alarmed := false | alarmed := false | |||
mismatch := func(id types.ID) { | mismatch := func(id types.ID) { | |||
if alarmed { | if alarmed { | |||
return | return | |||
} | } | |||
alarmed = true | alarmed = true | |||
cm.hasher.TriggerCorruptAlarm(id) | // It isn't clear which member's data is corrupted, so we | |||
// intentionally set the memberID as 0. We will identify | ||||
// the corrupted members using quorum in 3.6. Please see | ||||
// discussion in https://github.com/etcd-io/etcd/pull/14828. | ||||
cm.hasher.TriggerCorruptAlarm(types.ID(0)) | ||||
} | } | |||
if h2.Hash != h.Hash && rev2 == rev && h.CompactRevision == h2.CompactRev ision { | if h2.Hash != h.Hash && rev2 == rev && h.CompactRevision == h2.CompactRev ision { | |||
cm.lg.Warn( | cm.lg.Warn( | |||
"found hash mismatch", | "found hash mismatch", | |||
zap.Int64("revision-1", rev), | zap.Int64("revision-1", rev), | |||
zap.Int64("compact-revision-1", h.CompactRevision), | zap.Int64("compact-revision-1", h.CompactRevision), | |||
zap.Uint32("hash-1", h.Hash), | zap.Uint32("hash-1", h.Hash), | |||
zap.Int64("revision-2", rev2), | zap.Int64("revision-2", rev2), | |||
zap.Int64("compact-revision-2", h2.CompactRevision), | zap.Int64("compact-revision-2", h2.CompactRevision), | |||
skipping to change at line 279 | skipping to change at line 283 | |||
continue | continue | |||
} | } | |||
peersChecked := 0 | peersChecked := 0 | |||
for _, p := range peers { | for _, p := range peers { | |||
if p.resp == nil || p.resp.CompactRevision != hash.Compac tRevision { | if p.resp == nil || p.resp.CompactRevision != hash.Compac tRevision { | |||
continue | continue | |||
} | } | |||
// follower's compact revision is leader's old one, then hashes must match | // follower's compact revision is leader's old one, then hashes must match | |||
if p.resp.Hash != hash.Hash { | if p.resp.Hash != hash.Hash { | |||
cm.hasher.TriggerCorruptAlarm(p.id) | // It isn't clear which member's data is corrupte | |||
d, so we | ||||
// intentionally set the memberID as 0. We will i | ||||
dentify | ||||
// the corrupted members using quorum in 3.6. Ple | ||||
ase see | ||||
// discussion in https://github.com/etcd-io/etcd/ | ||||
pull/14828. | ||||
cm.hasher.TriggerCorruptAlarm(types.ID(0)) | ||||
cm.lg.Error("failed compaction hash check", | cm.lg.Error("failed compaction hash check", | |||
zap.Int64("revision", hash.Revision), | zap.Int64("revision", hash.Revision), | |||
zap.Int64("leader-compact-revision", hash .CompactRevision), | zap.Int64("leader-compact-revision", hash .CompactRevision), | |||
zap.Uint32("leader-hash", hash.Hash), | zap.Uint32("leader-hash", hash.Hash), | |||
zap.Int64("follower-compact-revision", p. resp.CompactRevision), | zap.Int64("follower-compact-revision", p. resp.CompactRevision), | |||
zap.Uint32("follower-hash", p.resp.Hash), | zap.Uint32("follower-hash", p.resp.Hash), | |||
zap.String("follower-peer-id", p.id.Strin g()), | zap.String("follower-peer-id", p.id.Strin g()), | |||
) | ) | |||
return | return | |||
} | } | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 14 lines changed or added |