Skip to content

Commit 82dfb84

Browse files
authored
Merge pull request #5933 from IntersectMBO/amesgen/invalid-snapshot-msg
Add more context to invalid snapshot events
2 parents 0841051 + 643f381 commit 82dfb84

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,13 @@ instance ( StandardHash blk
14941494
forHuman (LedgerDB.DeletedSnapshot snap) =
14951495
"Deleted old snapshot " <> showT snap
14961496
forHuman (LedgerDB.InvalidSnapshot snap failure) =
1497-
"Invalid snapshot " <> showT snap <> showT failure
1497+
"Invalid snapshot " <> showT snap <> showT failure <> context
1498+
where
1499+
context = case failure of
1500+
LedgerDB.InitFailureRead{} ->
1501+
" This is most likely an expected change in the serialization format,"
1502+
<> " which currently requires a chain replay"
1503+
_ -> ""
14981504

14991505
forMachine dtals (LedgerDB.TookSnapshot snap pt) =
15001506
mconcat [ "kind" .= String "TookSnapshot"

cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,13 @@ instance ( ConvertRawHash blk
587587
<> "%"
588588
ChainDB.TraceSnapshotEvent ev -> case ev of
589589
LedgerDB.InvalidSnapshot snap failure ->
590-
"Invalid snapshot " <> showT snap <> showT failure
590+
"Invalid snapshot " <> showT snap <> showT failure <> context
591+
where
592+
context = case failure of
593+
LedgerDB.InitFailureRead{} ->
594+
" This is most likely an expected change in the serialization format,"
595+
<> " which currently requires a chain replay"
596+
_ -> ""
591597
LedgerDB.TookSnapshot snap pt ->
592598
"Took ledger snapshot " <> showT snap <>
593599
" at " <> renderRealPointAsPhrase pt

0 commit comments

Comments
 (0)