Skip to content

Commit

Permalink
Merge pull request #5933 from IntersectMBO/amesgen/invalid-snapshot-msg
Browse files Browse the repository at this point in the history
Add more context to invalid snapshot events
  • Loading branch information
erikd committed Sep 13, 2024
2 parents 0841051 + 643f381 commit 82dfb84
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,13 @@ instance ( StandardHash blk
forHuman (LedgerDB.DeletedSnapshot snap) =
"Deleted old snapshot " <> showT snap
forHuman (LedgerDB.InvalidSnapshot snap failure) =
"Invalid snapshot " <> showT snap <> showT failure
"Invalid snapshot " <> showT snap <> showT failure <> context
where
context = case failure of
LedgerDB.InitFailureRead{} ->
" This is most likely an expected change in the serialization format,"
<> " which currently requires a chain replay"
_ -> ""

forMachine dtals (LedgerDB.TookSnapshot snap pt) =
mconcat [ "kind" .= String "TookSnapshot"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,13 @@ instance ( ConvertRawHash blk
<> "%"
ChainDB.TraceSnapshotEvent ev -> case ev of
LedgerDB.InvalidSnapshot snap failure ->
"Invalid snapshot " <> showT snap <> showT failure
"Invalid snapshot " <> showT snap <> showT failure <> context
where
context = case failure of
LedgerDB.InitFailureRead{} ->
" This is most likely an expected change in the serialization format,"
<> " which currently requires a chain replay"
_ -> ""
LedgerDB.TookSnapshot snap pt ->
"Took ledger snapshot " <> showT snap <>
" at " <> renderRealPointAsPhrase pt
Expand Down

0 comments on commit 82dfb84

Please sign in to comment.