https://bugs.openldap.org/show_bug.cgi?id=10551
Issue ID: 10551 Summary: mdb_put() returns MDB_PAGE_FULL depending on key-length parity and insertion order Product: LMDB Version: 1.0.0 Hardware: x86_64 OS: Linux Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: liblmdb Assignee: bugs@openldap.org Reporter: adam.req@gmx.de Target Milestone: ---
Created attachment 1175 --> https://bugs.openldap.org/attachment.cgi?id=1175&action=edit insertion order
## Background I am currently getting familiar with LMDB and encountered the following reproducible behavior.
## Tested versions * OpenLDAP LMDB (`master`) * LMDB (`mdb.RE/1.0`)
hint: 0.9.x was okay
## Description A new LMDB environment is created, followed by the creation of two DBIs. The attached key/value pairs are inserted using `mdb_put()` as follows (only the first dbi was used here):
Key: excl. comma, including the terminating null character (`'\0'`) Value: raw byte sequence (number of bytes exactly as shown in the attachment)
Example: GX\c, 100 -> means 4+1(zero)=5 bytes for key, and 100 bytes for value
The final call to `mdb_put()` fails with: MDB_PAGE_FULL: Internal error - page has no more space
## Reproduction The failure is reproducible using the attached key/value sequence in "insertion order" file. The error does not occur if either of the following changes is made (just tested):
* All keys are forced to have the same byte-length parity by appending an additional `0x00` byte where necessary (all keys become either even- or odd-sized). * The last two insertions are swapped.