File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
cardano-node/src/Cardano/Node/Configuration Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ data LedgerDbSelectorFlag =
4545 (Maybe Gigabytes )
4646 -- ^ A map size can be specified, this is the maximum disk space the LMDB
4747 -- database can fill. If not provided, the default of 16GB will be used.
48+ (Maybe Int )
49+ -- ^ An override to the max number of readers.
4850 | V1InMemory V1. FlushFrequency
4951 | V2InMemory
5052 deriving (Eq , Show )
@@ -129,10 +131,11 @@ defaultLMDBPath = "mainnet/db/lmdb"
129131selectorToArgs :: LedgerDbSelectorFlag -> Complete LedgerDbFlavorArgs IO
130132selectorToArgs (V1InMemory ff) = LedgerDbFlavorArgsV1 $ V1. V1Args ff V1. InMemoryBackingStoreArgs
131133selectorToArgs V2InMemory = LedgerDbFlavorArgsV2 $ V2. V2Args V2. InMemoryHandleArgs
132- selectorToArgs (V1LMDB ff fp l) =
134+ selectorToArgs (V1LMDB ff fp l mxReaders ) =
133135 LedgerDbFlavorArgsV1
134136 $ V1. V1Args ff
135137 $ V1. LMDBBackingStoreArgs
136138 (fromMaybe defaultLMDBPath fp)
137- (maybe id (\ ll lim -> lim { lmdbMapSize = toBytes ll }) l defaultLMDBLimits)
139+ (maybe id (\ overrideMaxReaders lim -> lim { lmdbMaxReaders = overrideMaxReaders }) mxReaders
140+ $ maybe id (\ ll lim -> lim { lmdbMapSize = toBytes ll }) l defaultLMDBLimits)
138141 Dict
Original file line number Diff line number Diff line change @@ -511,7 +511,8 @@ instance FromJSON PartialNodeConfiguration where
511511 flush <- (fmap RequestedFlushFrequency <$> o .:? " FlushFrequency" ) .!= DefaultFlushFrequency
512512 mapSize :: Maybe Gigabytes <- o .:? " MapSize"
513513 lmdbPath :: Maybe FilePath <- o .:? " LiveTablesPath"
514- return $ V1LMDB flush lmdbPath mapSize
514+ mxReaders :: Maybe Int <- o .:? " MaxReaders"
515+ return $ V1LMDB flush lmdbPath mapSize mxReaders
515516 " V2InMemory" -> return V2InMemory
516517 _ -> fail $ " Malformed LedgerDB Backend: " <> backend
517518 pure $ Just $ LedgerDbConfiguration ldbSnapNum ldbSnapInterval qsize selector deprecatedOpts
You can’t perform that action at this time.
0 commit comments