Another issue: This breaks because liblmdb does not change the node size when overwriting an overflow page:
mdb_put(txn, dbi, &key, &(MDB_val){9000, val}, 0); mdb_put(txn, dbi, &key, &(MDB_val){1, val}, 0); mdb_get(txn, dbi, &key, &data); assert(data.mv_size != 9000);
Fixed by 0cdd9dffddf66c730a35f48db2bb02d8bb3e5731. mdb_cursor_put() said: /* yes, overwrite it. Note in this case we don't * bother to try shrinking the node if the new data * is smaller than the overflow threshold. */ It's number of pages which does not need to shrink.