diff --git a/server/etcdserver/corrupt.go b/server/etcdserver/corrupt.go index 20e19fbb7..3aa5c78f1 100644 --- a/server/etcdserver/corrupt.go +++ b/server/etcdserver/corrupt.go @@ -86,7 +86,6 @@ func (h hasherAdapter) TriggerCorruptAlarm(memberID types.ID) { // before serving any peer/client traffic. Only mismatch when hashes // are different at requested revision, with same compact revision. func (cm *corruptionChecker) InitialCheck() error { - cm.lg.Info( "starting initial corruption check", zap.String("local-member-id", cm.hasher.MemberId().String()), @@ -260,7 +259,7 @@ func (cm *corruptionChecker) PeriodicCheck() error { // have different hashes. // // We might miss opportunity to perform the check if the compaction is still -// ongoing on one of the members or it was unresponsive. In such situation the +// ongoing on one of the members, or it was unresponsive. In such situation the // method still passes without raising alarm. func (cm *corruptionChecker) CompactHashCheck() { cm.lg.Info("starting compact hash check", diff --git a/server/storage/mvcc/hash.go b/server/storage/mvcc/hash.go index 0c8e92240..385d0c979 100644 --- a/server/storage/mvcc/hash.go +++ b/server/storage/mvcc/hash.go @@ -86,7 +86,12 @@ type KeyValueHash struct { } type HashStorage interface { - // Hash computes the hash of the KV's backend. + // Hash computes the hash of the whole backend keyspace, + // including key, lease, and other buckets in storage. + // This is designed for testing ONLY! + // Do not rely on this in production with ongoing transactions, + // since Hash operation does not hold MVCC locks. + // Use "HashByRev" method instead for "key" bucket consistency checks. Hash() (hash uint32, revision int64, err error) // HashByRev computes the hash of all MVCC revisions up to a given revision.