Skip to content

Commit

Permalink
Add more context to invalid snapshot events
Browse files Browse the repository at this point in the history
  • Loading branch information
amesgen committed Aug 1, 2024
1 parent 8829321 commit 0140f76
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 0140f76

Please sign in to comment.