@@ -35,6 +35,7 @@ import Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal (chunkN
35
35
import qualified Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types as ImmDB
36
36
import Ouroboros.Consensus.Storage.LedgerDB (ReplayStart (.. ),
37
37
UpdateLedgerDbTraceEvent (.. ))
38
+ import qualified Ouroboros.Consensus.Storage.LedgerDB.Snapshots as LedgerDB
38
39
import qualified Ouroboros.Consensus.Storage.LedgerDB as LedgerDB
39
40
import qualified Ouroboros.Consensus.Storage.VolatileDB as VolDB
40
41
import Ouroboros.Consensus.Util.Condense (condense )
@@ -1566,12 +1567,19 @@ instance ( StandardHash blk
1566
1567
]
1567
1568
where
1568
1569
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?"
1572
1580
_ -> " "
1573
1581
forHuman (LedgerDB. SnapshotMissingChecksum snap) =
1574
- Text. unwords [ " Snapshot missing checksum " , showT snap]
1582
+ " Checksum file is missing for snapshot " <> showT snap
1575
1583
1576
1584
forMachine dtals (LedgerDB. TookSnapshot snap pt enclosedTiming) =
1577
1585
mconcat [ " kind" .= String " TookSnapshot"
@@ -1586,19 +1594,20 @@ instance ( StandardHash blk
1586
1594
, " snapshot" .= forMachine dtals snap
1587
1595
, " failure" .= show failure ]
1588
1596
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
+ ]
1591
1600
1592
1601
instance MetaTrace (LedgerDB. TraceSnapshotEvent blk ) where
1593
1602
namespaceFor LedgerDB. TookSnapshot {} = Namespace [] [" TookSnapshot" ]
1594
1603
namespaceFor LedgerDB. DeletedSnapshot {} = Namespace [] [" DeletedSnapshot" ]
1595
1604
namespaceFor LedgerDB. InvalidSnapshot {} = Namespace [] [" InvalidSnapshot" ]
1596
- namespaceFor LedgerDB. SnapshotMissingChecksum {} = Namespace [] [" MissingChecksum " ]
1605
+ namespaceFor LedgerDB. SnapshotMissingChecksum {} = Namespace [] [" SnapshotMissingChecksum " ]
1597
1606
1598
1607
severityFor (Namespace _ [" TookSnapshot" ]) _ = Just Info
1599
1608
severityFor (Namespace _ [" DeletedSnapshot" ]) _ = Just Debug
1600
1609
severityFor (Namespace _ [" InvalidSnapshot" ]) _ = Just Error
1601
- severityFor (Namespace _ [" MissingChecksum " ]) _ = Just Error
1610
+ severityFor (Namespace _ [" SnapshotMissingChecksum " ]) _ = Just Warning
1602
1611
severityFor _ _ = Nothing
1603
1612
1604
1613
documentFor (Namespace _ [" TookSnapshot" ]) = Just $ mconcat
@@ -1610,15 +1619,15 @@ instance MetaTrace (LedgerDB.TraceSnapshotEvent blk) where
1610
1619
" A snapshot was deleted from the disk."
1611
1620
documentFor (Namespace _ [" InvalidSnapshot" ]) = Just
1612
1621
" 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. "
1615
1624
documentFor _ = Nothing
1616
1625
1617
1626
allNamespaces =
1618
1627
[ Namespace [] [" TookSnapshot" ]
1619
1628
, Namespace [] [" DeletedSnapshot" ]
1620
1629
, Namespace [] [" InvalidSnapshot" ]
1621
- , Namespace [] [" MissingChecksum " ]
1630
+ , Namespace [] [" SnapshotMissingChecksum " ]
1622
1631
]
1623
1632
1624
1633
0 commit comments