Skip to content

Commit 32da1ff

Browse files
committed
Maintain less snapshots
1 parent ea81e67 commit 32da1ff

File tree

1 file changed

+5
-5
lines changed
  • cardano-db-sync/src/Cardano/DbSync/Ledger

1 file changed

+5
-5
lines changed

cardano-db-sync/src/Cardano/DbSync/Ledger/State.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ storeSnapshotAndCleanupMaybe env oldState appResult blkNo isCons syncState =
333333
Just newEpoch
334334
| newEpochNo <- unEpochNo (Generic.neEpoch newEpoch)
335335
, newEpochNo > 0
336-
, isCons || (newEpochNo `mod` 10 == 0) || newEpochNo >= 503 ->
336+
, isCons || (newEpochNo `mod` 10 == 0) || newEpochNo >= 530 ->
337337
do
338338
-- TODO: Instead of newEpochNo - 1, is there any way to get the epochNo from 'lssOldState'?
339339
liftIO $ saveCleanupState env oldState (Just $ EpochNo $ newEpochNo - 1)
@@ -480,10 +480,10 @@ cleanupLedgerStateFiles env slotNo = do
480480
let (epochBoundary, valid, invalid) = foldr groupFiles ([], [], []) files
481481
-- Remove invalid (ie SlotNo >= current) ledger state files (occurs on rollback).
482482
deleteAndLogFiles env "invalid" invalid
483-
-- Remove all but 6 most recent state files.
484-
deleteAndLogStateFile env "old" (List.drop 3 valid)
485-
-- Remove all but 6 most recent epoch boundary state files.
486-
deleteAndLogStateFile env "old epoch boundary" (List.drop 6 epochBoundary)
483+
-- Remove all but 3 most recent state files.
484+
deleteAndLogStateFile env "old" (List.drop 2 valid)
485+
-- Remove all but 3 most recent epoch boundary state files.
486+
deleteAndLogStateFile env "old epoch boundary" (List.drop 3 epochBoundary)
487487
where
488488
groupFiles ::
489489
LedgerStateFile ->

0 commit comments

Comments
 (0)