@@ -35,6 +35,7 @@ import Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal (chunkN
3535import qualified Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types as ImmDB
3636import Ouroboros.Consensus.Storage.LedgerDB (ReplayStart (.. ),
3737 UpdateLedgerDbTraceEvent (.. ))
38+ import qualified Ouroboros.Consensus.Storage.LedgerDB.Snapshots as LedgerDB
3839import qualified Ouroboros.Consensus.Storage.LedgerDB as LedgerDB
3940import qualified Ouroboros.Consensus.Storage.VolatileDB as VolDB
4041import Ouroboros.Consensus.Util.Condense (condense )
@@ -1566,12 +1567,19 @@ instance ( StandardHash blk
15661567 ]
15671568 where
15681569 context = case failure of
1569- LedgerDB. InitFailureRead {} ->
1570- " This is most likely an expected change in the serialization format,"
1571- <> " which currently requires a chain replay"
1570+ LedgerDB. InitFailureRead LedgerDB. ReadSnapshotFailed {} ->
1571+ " This is most likely an expected change in the serialization format,"
1572+ <> " which currently requires a chain replay"
1573+ LedgerDB. InitFailureRead LedgerDB. ReadSnapshotDataCorruption ->
1574+ " The checksum does not match the snapshot. Seems like the snapshot is corrupted"
1575+ LedgerDB. InitFailureRead LedgerDB. ReadSnapshotInvalidChecksumFile {} ->
1576+ " The checksum file contains malformed json"
1577+ LedgerDB. InitFailureRead LedgerDB. ReadSnapshotNoChecksumFile {} ->
1578+ " Snapshot checksum checks are enabled but the snapshot had no checksum file."
1579+ <> " Did you intend to disable them with `\" DoDiskSnapshotChecksum\" : True` in the configuration file?"
15721580 _ -> " "
15731581 forHuman (LedgerDB. SnapshotMissingChecksum snap) =
1574- Text. unwords [ " Snapshot missing checksum " , showT snap]
1582+ " Checksum file is missing for snapshot " <> showT snap
15751583
15761584 forMachine dtals (LedgerDB. TookSnapshot snap pt enclosedTiming) =
15771585 mconcat [ " kind" .= String " TookSnapshot"
@@ -1586,19 +1594,20 @@ instance ( StandardHash blk
15861594 , " snapshot" .= forMachine dtals snap
15871595 , " failure" .= show failure ]
15881596 forMachine dtals (LedgerDB. SnapshotMissingChecksum snap) =
1589- mconcat [ " kind" .= String " MissingChecksum"
1590- , " snapshot" .= forMachine dtals snap ]
1597+ mconcat [ " kind" .= String " SnapshotMissingChecksum"
1598+ , " snapshot" .= forMachine dtals snap
1599+ ]
15911600
15921601instance MetaTrace (LedgerDB. TraceSnapshotEvent blk ) where
15931602 namespaceFor LedgerDB. TookSnapshot {} = Namespace [] [" TookSnapshot" ]
15941603 namespaceFor LedgerDB. DeletedSnapshot {} = Namespace [] [" DeletedSnapshot" ]
15951604 namespaceFor LedgerDB. InvalidSnapshot {} = Namespace [] [" InvalidSnapshot" ]
1596- namespaceFor LedgerDB. SnapshotMissingChecksum {} = Namespace [] [" MissingChecksum " ]
1605+ namespaceFor LedgerDB. SnapshotMissingChecksum {} = Namespace [] [" SnapshotMissingChecksum " ]
15971606
15981607 severityFor (Namespace _ [" TookSnapshot" ]) _ = Just Info
15991608 severityFor (Namespace _ [" DeletedSnapshot" ]) _ = Just Debug
16001609 severityFor (Namespace _ [" InvalidSnapshot" ]) _ = Just Error
1601- severityFor (Namespace _ [" MissingChecksum " ]) _ = Just Error
1610+ severityFor (Namespace _ [" SnapshotMissingChecksum " ]) _ = Just Warning
16021611 severityFor _ _ = Nothing
16031612
16041613 documentFor (Namespace _ [" TookSnapshot" ]) = Just $ mconcat
@@ -1610,15 +1619,15 @@ instance MetaTrace (LedgerDB.TraceSnapshotEvent blk) where
16101619 " A snapshot was deleted from the disk."
16111620 documentFor (Namespace _ [" InvalidSnapshot" ]) = Just
16121621 " An on disk snapshot was invalid. Unless it was suffixed, it will be deleted"
1613- documentFor (Namespace _ [" MissingChecksum " ]) = Just
1614- " Snapshot is missing checksum "
1622+ documentFor (Namespace _ [" SnapshotMissingChecksum " ]) = Just
1623+ " Checksum file was missing for snapshot. "
16151624 documentFor _ = Nothing
16161625
16171626 allNamespaces =
16181627 [ Namespace [] [" TookSnapshot" ]
16191628 , Namespace [] [" DeletedSnapshot" ]
16201629 , Namespace [] [" InvalidSnapshot" ]
1621- , Namespace [] [" MissingChecksum " ]
1630+ , Namespace [] [" SnapshotMissingChecksum " ]
16221631 ]
16231632
16241633
0 commit comments