Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase LMDB Size limit for all the DB - Temporary fix #5

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/keri/db/dbing.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,20 @@

from hio.base import filing

from .. import help
from ..help import helping

logger = help.ogler.getLogger()

ProemSize = 32 # does not include trailing separator
MaxProem = int("f"*(ProemSize), 16)
MaxON = int("f"*32, 16) # largest possible ordinal number, sequence or first seen

SuffixSize = 32 # does not include trailing separator
MaxSuffix = int("f"*(SuffixSize), 16)

KERIDBMapSizeKey = "KERI_DB_MAP_SIZE"

def dgKey(pre, dig):
"""
Returns bytes DB key from concatenation of '.' with qualified Base64 prefix
Expand Down Expand Up @@ -381,6 +386,13 @@ def reopen(self, readonly=False, **kwa):

# open lmdb major database instance
# creates files data.mdb and lock.mdb in .dbDirPath
if (mapSize := os.getenv(KERIDBMapSizeKey)) is not None:
try:
self.MapSize = int(mapSize)
except ValueError:
logger.error("KERI_DB_MAP_SIZE must be an integer value >1!")
raise

self.env = lmdb.open(self.path, max_dbs=self.MaxNamedDBs, map_size=self.MapSize,
mode=self.perm, readonly=self.readonly)
self.opened = True if opened and self.env else False
Expand Down
Loading