https://bugs.openldap.org/show_bug.cgi?id=9619
--- Comment #3 from Srinarasi bhargavabhat@gmail.com --- I can still reproduce this corruption.
Here's what I'm doing: 1) Open the env and create a DB. 2) Write one entry with 2019 bytes of value and a 7 byte key. 3) Compact with `mdb_env_copy2(MDB_CP_COMPACT)` 4) Close the env. 5) Remove the old db, replace it with the compacted file. 6) Open the env and the db 7) Try to write a 4000 byte value to the key that I was using in step 2.
I get MDB_KEYEXIST in the test I'm attaching. But I have seen it crash in some cases.
I see that value being >2019 bytes is the tipping point. The DB is fine if I write any less than that.
I'm attaching the test I'm using.