Skip to content

Commit 5e730a8

Browse files
committed
Drop unnecessary "/tvar" path for tables in InMemory snapshots
1 parent a92a746 commit 5e730a8

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

ouroboros-consensus-cardano/app/snapshot-converter.hs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ data OutEnv = OutEnv
233233
LedgerState (CardanoBlock StandardCrypto) EmptyMK ->
234234
ResourceRegistry IO ->
235235
IO (SinkArgs (LedgerState (CardanoBlock StandardCrypto)) IO)
236-
, outCreateExtra :: Maybe FilePath
237236
, outDeleteExtra :: Maybe FilePath
238237
, outProgressMsg :: String
239238
, outBackend :: SnapshotBackend
@@ -293,7 +292,6 @@ main = withStdTerminalHandles $ do
293292

294293
wipeOutputPaths OutEnv{..} = do
295294
wipePath outFilePath
296-
lift $ maybe (pure ()) (D.createDirectory . (outFilePath F.</>)) outCreateExtra
297295
maybe
298296
(pure ())
299297
wipePath
@@ -356,7 +354,7 @@ main = withStdTerminalHandles $ do
356354
InEnv
357355
st
358356
fp
359-
(fromInMemory (fp F.</> "tables" F.</> "tvar"))
357+
(fromInMemory (fp F.</> "tables"))
360358
("InMemory@[" <> fp <> "]")
361359
c
362360
mtd
@@ -412,8 +410,7 @@ main = withStdTerminalHandles $ do
412410
pure $
413411
OutEnv
414412
fp
415-
(toInMemory (fp F.</> "tables" F.</> "tvar"))
416-
(Just "tables")
413+
(toInMemory (fp F.</> "tables"))
417414
Nothing
418415
("InMemory@[" <> fp <> "]")
419416
UTxOHDMemSnapshot
@@ -431,7 +428,6 @@ main = withStdTerminalHandles $ do
431428
fp
432429
(toLMDB fp defaultLMDBLimits)
433430
Nothing
434-
Nothing
435431
("LMDB@[" <> fp <> "]")
436432
UTxOHDLMDBSnapshot
437433
LSM fp lsmDbPath -> do
@@ -447,7 +443,6 @@ main = withStdTerminalHandles $ do
447443
OutEnv
448444
fp
449445
(toLSM lsmDbPath (last $ splitDirectories fp))
450-
Nothing
451446
(Just lsmDbPath)
452447
("LSM@[" <> lsmDbPath <> "]")
453448
UTxOHDLSMSnapshot

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/InMemory.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,10 @@ newInMemoryLedgerTablesHandle tracer someFS@(SomeHasFS hasFS) l = do
140140
)
141141
)
142142
, takeHandleSnapshot = \hint snapshotName -> do
143-
createDirectoryIfMissing hasFS True $ mkFsPath [snapshotName, "tables"]
144143
h <- readTVarIO tv
145144
guardClosed h $
146145
\values ->
147-
withFile hasFS (mkFsPath [snapshotName, "tables", "tvar"]) (WriteMode MustBeNew) $ \hf ->
146+
withFile hasFS (mkFsPath [snapshotName, "tables"]) (WriteMode MustBeNew) $ \hf ->
148147
fmap (Just . snd) $
149148
hPutAllCRC hasFS hf $
150149
CBOR.toLazyByteString $
@@ -275,7 +274,7 @@ loadSnapshot tracer _rr ccfg fs ds = do
275274
(valuesMKDecoder extLedgerSt)
276275
( fsPathFromList $
277276
fsPathToList (snapshotToDirPath ds)
278-
<> [fromString "tables", fromString "tvar"]
277+
<> [fromString "tables"]
279278
)
280279
let computedCRC = crcOfConcat checksumAsRead crcTables
281280
Monad.when (computedCRC /= snapshotChecksum snapshotMeta) $

0 commit comments

Comments
 (0)