[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
RE: MDB_BAD_VALSIZE error
Howard Chu wrote:
> Chris Card wrote:
>> Howard Chu wrote:
>>> Subject: Re: MDB_BAD_VALSIZE error
>>>
>>> Chris Card wrote:
>>>> Hi All,
>>>>
>>>> I'm running openldap 2.4.36 on centos 6.3, 64 bit.
>>>>
>>>> I'm finally trying out MDB as a replacement for BDB in our openldap setup, and I've noticed that I'm getting MDB_BAD_VALSIZE errors when adding some DNs, which could be added without error when using BDB as the backend:
>>>>
>>>> 52e9170b <= mdb_dn2id_add 0x5da55e: -30781
>>>> 52e9170b mdb_add: dn2id_add failed: MDB_BAD_VALSIZE: Too big key/data, key is empty, or wrong DUPFIXED size (-30781)
>>>>
>>>> Looking at the code, it seems that this error happens when MDB_MAXKEYSIZE is exceeded and MDB_MAXKEYSIZE is set to 511 as far as I can see.
>>>>
>>>> The DNs which are giving this error are between 232 and 255 characters long.
>>>>
>>>> Does the MDB backend have an implicit limit on the length of valid DNs?
>>>
>>> slapd has a limit of 8192 bytes on DNs. RDNs in back-mdb are limited by
>>> MDB_MAXKEYSIZE.
>>>
>>>> Can this be increased (by changing MDB_MAXKEYSIZE) and if so, what is the longest DN which can be supported by the MDB backend?
>>>
>>> The longest DN supported is 8192 bytes. The longest RDN would be something
>>> close to one half of MDB_MAXKEYSIZE.
>>>
>> Thanks, I understand now. The longest RDN appears to be 245 characters on my system. Can MDB_MAXKEYSIZE be increased? If so, what is the maximum safe value?
>
> Read the comments in lmdb.h and/or mdb.c. The limits are documented there.
In 2.4.36 the comment is:
* We require that keys all fit onto a regular page. This limit
* could be raised a bit further if needed; to something just
* under #MDB_PAGESIZE / #MDB_MINKEYS.
In 2.4.38 the comment is:
* We require that keys all fit onto a regular page. This limit
* could be raised a bit further if needed; to something just
* under (page size / #MDB_MINKEYS / 3).
Is the comment for 2.4.38 the correct one? And should I read that as (page size) / (#MDB_MINKEYS * 3) ?
Chris