diff options
author | Simon Frei <freisim93@gmail.com> | 2021-06-07 23:10:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-07 23:10:35 +0200 |
commit | 1a226893281b0a7d680e8b4218f781bde7d84831 (patch) | |
tree | a038791b677e9420e986df987ad07dfa8248d6d7 | |
parent | ce65aea0abf0b79f54b351f637ad6a15d1350ad4 (diff) |
lib/db: Add failure reports to failures iterating over hashes (#7755)v1.18.0-rc.1
-rw-r--r-- | lib/db/transactions.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/db/transactions.go b/lib/db/transactions.go index 7e41b9655..ce0061b0c 100644 --- a/lib/db/transactions.go +++ b/lib/db/transactions.go @@ -398,12 +398,16 @@ func (t *readOnlyTransaction) withBlocksHash(folder, hash []byte, iterator Itera f.Name = osutil.NativeFilename(f.Name) if !bytes.Equal(f.BlocksHash, hash) { - l.Warnf("Mismatching block map list hashes: got %x expected %x", f.BlocksHash, hash) + msg := "Mismatching block map list hashes" + t.evLogger.Log(events.Failure, fmt.Sprintln(msg, "in withBlocksHash")) + l.Warnf("%v: got %x expected %x", msg, f.BlocksHash, hash) continue } if f.IsDeleted() || f.IsInvalid() || f.IsDirectory() || f.IsSymlink() { - l.Warnf("Found something of unexpected type in block list map: %s", f) + msg := "Found something of unexpected type in block list map" + t.evLogger.Log(events.Failure, fmt.Sprintln(msg, "in withBlocksHash")) + l.Warnf("%v: %s", msg, f) continue } |